Hey, erstes bei dem Befehl wird der Chat zugespammt mit Du hast die parkkralle ans Auto gebracht.
2. Man kann den Motor immer noch starten und fahren.
Hier der Code
if(strcmp(cmd, "/parkkralle", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(SpielerInfo[playerid][sLeader] == 18 SpielerInfo[playerid][sMember] == 18)
{
new Float:bX,Float:bY,Float:bZ;
GetPlayerPos(playerid,bX,bY,bZ);
new Float:aX,Float:aY,Float:aZ;
new Found=0;
new vid=0;
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "============= [Parkkralle] =============");
SendClientMessage(playerid, COLOR_WHITE, "FEHLER: /parkkralle [name]");
SendClientMessage(playerid, COLOR_GREY, "Verfügbare namen: Anbauen, Abbauen");
SendClientMessage(playerid, COLOR_WHITE, "============= [Parkkralle] =============");
return 1;
}
if(strcmp(x_nr,"Anbauen",true) == 0)
{
while((vid<MAX_VEHICLES)&&(!Found))
{
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(IsACopCar(vid) && IsAnArmyCar(vid) && IsAAOCar(vid) && IsAFBICar(vid) && IsAnAmbulance(vid) && IsAPlane(vid))
{
SendClientMessage(playerid,0x33CCFFAA,"An diese Fahrzeuge kannst du keine Parkkralle bauen!");
return 1;
}
else
{
GetPlayerName(playerid, sendername, sizeof(sendername));
Parkkralle[vid] = 1;
format(string, sizeof(string), "* %s baut eine Parkkralle an das Fahrzeug.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
OnPlayerCarUpdate(playerid);
}
}
}
}
if(strcmp(x_nr,"Abbauen",true) == 0)
{
while((vid<MAX_VEHICLES)&&(!Found))
{
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)))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
Parkkralle[vid] = 0;
format(string, sizeof(string), "* %s baut die Parkkralle des Fahrzeugs ab.", sendername, handyname);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
OnPlayerCarUpdate(playerid);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Du gehörst nicht zum ADAC!");
}
}
}