24.10.2010, 11:41
How can i make a certain class/team only be able to drive a certain vehicle?
Thanks in advanced
Thanks in advanced
new restrictedvehicle;
public OnGameModeInit()
{
restrictedvehicle = CreateVehicle(blablabla...);
return 1;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerTeam(playerid) != TEAM_WHATEVER && GetPlayerVehicleID(playerid) == restrictedvehicle)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,red,"You are not allowed to drive that vehicle");
}
}
return 1;
}
Here's an example of doing it with OnPlayerStateChange.
pawn Код:
|