14.04.2013, 19:09
Hello, i have this code to lock big vehicles (rhino, hunter, hydra, seasparrow), if there are < 15 players online, i tried this:
Placed on OnPlayerStateChange, but it locks EVERY vehicle i try to enter and not just the selected vehicle models.
pawn Code:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && GetOnlinePlayers() < 15)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 520 || 432 || 425 || 447 || 476) //Whore vehicles locking
{
SCM(playerid,0xAA3333AA,"You can drive this vehicle if there are more than 15 players online.");
RemovePlayerFromVehicle(playerid);
return 1;
}
}