Das ist der "Server-Downleg-Command"
Versuchs mal so:
#define DIALOG_SIRENEAN 4789
#define DIALOG_SIRENEAUS 4788
if(strcmp(cmdtext,"/sirene",true)==0)
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Du bist kein Cop!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid);
if(sirenean[vid] == false)
{
ShowPlayerDialog(playerid,DIALOG_SIRENEAN,DIALOG_STYLE_MSGBOX,"Polizei Sirene","Möchtest du eine Sirene an dieses Fahrzeug anbauen ?","Ja","Nein");
}
else if(sirenean[vid] == true)
{
ShowPlayerDialog(playerid,DIALOG_SIRENEAUS,DIALOG_STYLE_MSGBOX,"Polizei Sirene","Möchtest du die Sirene dieses Fahrzeuges abbauen ?","Ja","Nein");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Du bist in keinem Fahrzeug!");
}
return 1;
}
if(dialogid== DIALOG_SIRENEAN)
{
if(response == 0)
{
return 1;
}
if(response == 1)
{
new vid = GetPlayerVehicleID(playerid);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
sirene[vid] = CreateObject(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 angebaut!");
}
}
if(dialogid== DIALOG_SIRENEAUS)
{
if(response == 0)
{
return 1;
}
if(response == 1)
{
new vid = GetPlayerVehicleID(playerid);
DestroyObject(sirene[vid]);
sirenean[vid] =false;
SendClientMessage(playerid,0xFF0000,"Du hast die Sirene abgebaut!");
}
}
PS: Zu deinem CMD:
Haste Include drin und unter OnPlayerCommandText dcmd(sirene,6,cmdtext); ?
MfG.
Me