02.12.2017, 23:02
I would just create a variable 'SirenStatus' and use that to store and determine the siren status.
Код:
new SirenStatus[MAX_PLAYERS] = false; CMD:siren(playerid, params[]) { if(fInfo[playerid][fPolice] != 1) return SCM(playerid, COR_CINZA, "You are not a Police Officer."); if(SirenStatus[playerid] == true) // Siren is already on { SirenStatus[playerid] = false; // The siren is on, so we turn it off. // Place code here to turn off the siren return SendClientMessage(playerid, COLOR_GREY, "You turned your siren off."); } SirenStatus[playerid] = true; // The siren is off, so we turn it on. glob4 = GetPlayerVehicleID(playerid); glob3 = CreateObject(18646, -0.7, 0.15, 0.85, 0.0, 0.0, 96.0, 0); AttachObjectToVehicle(glob3, glob4, 0.014999, -0.379999, 0.914999, 0.000000, 0.000000, 0.000000); SendClientMessage(playerid, COLOR_GREY, "You turned your siren on."); return 1; }