01.12.2014, 11:22
Hi
I am trying to make this function so when a player enters a cop car, and they are not part of the police faction it will remove them from the car and tell them they are not part of that faction. But only if they are in the driver seat.
Here is my code:
This is under ongamemodeinit:
I am trying to make this function so when a player enters a cop car, and they are not part of the police faction it will remove them from the car and tell them they are not part of that faction. But only if they are in the driver seat.
Here is my code:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { new vehicleid = GetPlayerVehicleID(playerid); if(newstate == 2) { SetPlayerArmedWeapon(playerid, 0); if(IsLAPDVeh(vehicleid) && pInfo[playerid][pFaction] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY, "You are not in the LAPD"); } else if(IsLAFMDVeh(vehicleid) && pInfo[playerid][pFaction] != 2) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_GREY, "You are not in the LAFMD"); } } return 1; } stock IsLAPDVeh(vehicleid) { for(new i = 0; i < sizeof(LAPDVeh); ++i) { if(vehicleid == LAPDVeh[i]) return 1; } return 0; }
Код:
LAPDVeh[0] = AddStaticVehicleEx(596, 1602.8655, -1684.0818, 5.5351, 89.8200, -1, -1, 3000);