08.07.2014, 00:08
Example:
The code above will only work if the player is not an RCON Administrator, so you will have to replace '!IsPlayerAdmin(playerid)' with your own admin variable, eg. 'PlayerInfo[playerid][AdminLevel] < 1'
Sources:
https://sampwiki.blast.hk/wiki/OnPlayerStateChange
https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate) //Called when a player changes state
{
if(newstate & PLAYER_STATE_DRIVER) //If player enters as a driver in a vehicle
{
if(!IsPlayerAdmin(playerid)) //If the player is not an admin, replace this with your admin variable.
{
RemovePlayerFromVehicle(playerid); //Remove the player from the vehicle
}
}
return 1;
}
Sources:
https://sampwiki.blast.hk/wiki/OnPlayerStateChange
https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle