10.02.2018, 13:31
Hi all,
i am trying to redo a siren command i got and i am having trouble with the system of it
Basically when i do /siren in game it spawns them all but when i do it again it only destroys one object so i have to type /siren 3 times to remove them all is there anything i can change it to make it destroy all 3 objects at once?
i am trying to redo a siren command i got and i am having trouble with the system of it
Код:
CMD:siren(playerid, params[]) { //if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); //if(!IsACop(playerid) && !IsAHSF(playerid) && !IsASWAT(playerid) && !IsASATF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD/HSF Member."); if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You are not the vehicle driver"); new pveh = GetPlayerVehicleID(playerid); if (!GetVehicleModel(pveh)) return SendClientMessage(playerid, -1, "You are not inside a vehicle"); if (VObject5(obj1[pveh])) return SendClientMessage(playerid, -1, "You switched your siren off"), DObject5(obj1[pveh]); if (VObject4(obj2[pveh])) return SendClientMessage(playerid, -1, "You switched your siren off"), DObject4(obj2[pveh]); if (VObject3(obj3[pveh])) return SendClientMessage(playerid, -1, "You switched your siren off"), DObject3(obj3[pveh]); switch (GetVehicleModel(pveh)) { //19419 - Lightbar, ***18646 - Dash***, 19292 - blue flash, 19294 - yellow flash, 19290 red flash case 560: { obj1[pveh] = CObject5(19797, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AObject5(obj1[pveh], pveh, -0.2500000, 2.6000000, 0.06, 0.000000, 0.000000, 180.000000); obj2[pveh] = CObject4(19797, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AObject4(obj2[pveh], pveh, 0.2500000, 2.6000000, 0.06, 0.000000, 0.000000, 180.000000); obj3[pveh] = CObject3(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AObject3(obj3[pveh], pveh, 0.000000, 1.7000000, 0.0, 0.000000, 0.000000, 0.000000); } default: { return SendClientMessage(playerid, -1, "* You are not in an emergency vehicle!"); } } return SendClientMessage(playerid, -1, "Siren activated"); }