A question
#4

Example:
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;
}
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
Reply


Messages In This Thread
A question - by ilay65 - 07.07.2014, 23:49
Re: A question - by rappy93 - 08.07.2014, 00:02
Re : A question - by S4t3K - 08.07.2014, 00:06
Re: A question - by Threshold - 08.07.2014, 00:08
Re: A question - by gtasarules14 - 08.07.2014, 00:09
Re : A question - by S4t3K - 08.07.2014, 00:12
Re: A question - by Threshold - 08.07.2014, 00:19

Forum Jump:


Users browsing this thread: 3 Guest(s)