28.09.2014, 11:33
(
Последний раз редактировалось alibalicharlton; 28.09.2014 в 12:03.
)
I am trying to detect when a player changes car, and if it's a banned car, then destroy it. If they are on foot and spawn the car, then it works. If they are already in a car and they spawn a banned car then it doesn't, any ideas?
When on foot, OnPlayerVehicleChange is never called.
The robber value is just a variable for a playerid, as the vehicles are only restricted with this player.
Код:
public OnPlayerUpdate(playerid) { if(playerid==robber) { if(robbercar != GetPlayerVehicleID(playerid)) { OnPlayerVehicleChange(playerid,GetPlayerVehicleID(playerid)); } } } OnPlayerVehicleChange(playerid,vehicleid) { switch(GetVehicleModel(vehicleid)) { case 592: RestrictedCar(playerid,"Andromada"); } robbercar=GetPlayerVehicleID(playerid); }
The robber value is just a variable for a playerid, as the vehicles are only restricted with this player.