Hey ,
ich brauche hierbei hilfe ich finde den fehler nicht wenn man den befehl ausführt hängt sich der server auf
ich bitte um hilfe
if(strcmp(cmd, "/parkamt", true) == 0)
{
if(SpielerInfo[playerid][sMember] == 18)
{
tmp = strtok(cmdtext,idx);
new Float:bX,Float:bY,Float:bZ;
GetPlayerPos(playerid,bX,bY,bZ);
new Float:aX,Float:aY,Float:aZ;
if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"==[parkamt]== /parkamt [name] >>> [Anbauen oder Abbauen]");
if(strcmp(tmp,"Anbauen",true) == 0)
{
for(new vid;vid!=MAX_VEHICLES;vid++)
{
GetVehiclePos(vid,aX,aY,aZ);
if((floatabs(bX-aX)<3.0)&&(floatabs(bY-aY)<3.0)&&(floatabs(bZ-aZ)<3.0)&&(vid!=GetPlayerVehicleID(playerid)))
{
if(!IsADtCar(vid))
{
new fc;while(fc<MAX_FRACTION_CARS){
if(FractionCars[fc][fVehid] >= 400 && FractionCars[fc][fVehid] <= 611)
{
if(FractionCars[fc][fCarid] == vid)
{
FractionCars[fc][fparkamt] = 1;
format(globquery, sizeof(globquery), "* %s baut eine parkamt an das Fahrzeug.", GetName(playerid));
ProxDetector(30.0, playerid, globquery, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
}
}
else
{
//Wird gemacht
new theOwner = GetOwner(vid);
new xid;
for(new x;x!=MaxVeh;x++)
{
if(Dtc_PlayerHaveCar[playerid][x])
{
if(vid == PlayerCar[theOwner][x][CarId])
{
xid = x;
break;
}
}
}
PlayerCar[theOwner][xid][Kralle] = 1;
format(globquery,256,"UPDATE `carsystem` SET `Kralle`='1' WHERE `CarOwner`='%s_%d'",GetName(playerid),xid);
mysql_query(globquery);
format(globquery, sizeof(globquery), "* %s baut eine parkamt an das Fahrzeug.", GetName(playerid));
ProxDetector(30.0, playerid, globquery, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
}
}
else if(strcmp(tmp,"Abbauen",true) == 0)
{
for(new vid;vid!=MAX_VEHICLES;vid++)
{
GetVehiclePos(vid,aX,aY,aZ);
if ((floatabs(bX-aX)<3.0)&&(floatabs(bY-aY)<3.0)&&(floatabs(bZ-aZ)<3.0)&&(vid!=GetPlayerVehicleID(playerid)))
{
new theOwner = GetOwner(vid);
new xid;
for(new x;x!=MaxVeh;x++)
{
if(Dtc_PlayerHaveCar[playerid][x])
{
if(vid == PlayerCar[theOwner][x][CarId])
{
xid = x;
break;
}
}
}
PlayerCar[theOwner][xid][Kralle] = 0;
format(globquery,256,"UPDATE `carsystem` SET `Kralle`='0' WHERE `CarOwner`='%s_%d'",GetName(playerid),xid);
mysql_query(globquery);
format(globquery, sizeof(globquery), "* %s baut die parkamt des Fahrzeugs ab.", GetName(playerid));
ProxDetector(30.0, playerid, globquery, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "============= [parkamt] =============");
SendClientMessage(playerid, COLOR_RED, "FEHLER: /parkamt [name]");
SendClientMessage(playerid, COLOR_GREY, "Verfügbare Namen: Anbauen, Abbauen");
SendClientMessage(playerid, COLOR_WHITE, "============= [parkamt] =============");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Du gehörst nicht zum Ordnungsamt!");
return 1;
}
return 1;
}