17.10.2013, 15:01
I don't understand why if I do /siren while onfoot it says "You are not in a vehicle" then when i'm inside a vehicle then I do /siren it says "Siren Deactivated"?
So its like I already activated the siren while onfoot? even it says You are not in a vehicle?
So its like I already activated the siren while onfoot? even it says You are not in a vehicle?
Код:
CMD:siren(playerid, params[]) { if(pInfo[playerid][Donator] >= 1) { if(IsSiren[playerid] == 0) { IsSiren[playerid] = 1; if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, white, "{FF0000}>> You are not in a vehicle"); if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, white, "{FF0000}>> You must be the driver to use this Command"); new VID = GetPlayerVehicleID(playerid); if(Siren[VID] == 1) return SendClientMessage(playerid, white, "{FF0000}>> This vehicle already has a Siren"); Siren[VID] = 1; GameTextForPlayer(playerid,"~y~Siren ~g~~n~Activated",2000,3); SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0); AttachObjectToVehicle(SirenObject[VID], VID, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0); } else { IsSiren[playerid] = 0; if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, white, "{FF0000}>> You are not in a vehicle"); if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, white, "{FF0000}>> You must be the driver to use this Command"); new VID = GetPlayerVehicleID(playerid); if(Siren[VID] == 0) Siren[VID] = 0; GameTextForPlayer(playerid,"~y~Siren ~r~~n~Deactivated",2000,3); DestroyObject(SirenObject[VID]); } } else return ShowPlayerDialog(playerid, DIALOG_NOVIP, DIALOG_STYLE_MSGBOX, "{09F7DF}NONE-VIP Members", "\nYou must be at least VIP Level 1 (Bronze)", "Close", ""); return 1; }