Füge das anstelle deines ein:
[pwn]dcmd_sirene(playerid,params[])
{
new status[1];
if(sscanf(params,"s",status)) { return SendClientMessage(playerid,0xFF0000,"Benutzung: /sirene [an/aus]"); }
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Du bist kein Cop!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid);
if(strcmp(status,"an",true) == 0)
{
if(sirenean[vid] == true)return SendClientMessage(playerid,0xFF0000,"Dieses Fahrzeug hat bereits eine Sirene!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
sirene[vid] = CreateDynamicObject(18646,x,y,z,0,0,0,100);
AttachObjectToVehicle(sirene[vid],vid,-0.5, -0.2, 0.8, 2.0, 2.0, 3.0);
sirenean[vid] = true;
SendClientMessage(playerid,0xFF0000,"Du hast die Sirene angeschaltet!");
}
else
if(strcmp(status,"aus",true) == 0)
{
if(sirenean[vid] == false)return SendClientMessage(playerid,0xFF0000,"Dieses Fahrzeug hat keine Sirene");
DestroyObject(sirene[vid]);
sirenean[vid] =false;
SendClientMessage(playerid,0xFF0000,"Du hast die Sirene ausgeschaltet!");
}
}
return 1;
}[/pwn]