24.03.2017, 11:24
As Jelly23 said it would be better to use callback, in your stock you dont have playerid so you would have to loop through every player on server so it would take a while.
Insted you could use something like this in OnPlayerEnterVehicle callback
Insted you could use something like this in OnPlayerEnterVehicle callback
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid==420 || vehicleid == 438) { RemovePlayerFromVehicle(playerid); // Or if he didn't enter already and is about to enter then it's an animation // then use ClearAnimations(playerid); return SendClientMessage(playerid, 0xFF0000FF, "You cant enter this vehicle"); } }