SA-MP Forums Archive
[HELP]OnPlayerStateChange[HELP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]OnPlayerStateChange[HELP] (/showthread.php?tid=545214)



[HELP]OnPlayerStateChange[HELP] - Justinclaveria123 - 07.11.2014

Hello Guys!
i need help for OnPlayerKeyStateChange , i am wondering how to make the player kick from vehicle of Government vehicles if they not a police .
heres the code , can someone can do it for me? i'll give rep+
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(
    {
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}



Re: [HELP]OnPlayerStateChange[HELP] - BpX - 07.11.2014

I'll assume that your "Government Vehicle" includes an SF Police Car.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)  //Checks if player has entered a vehicle as a driver
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 596) //Checks if the vehicle that he has entered with is an SF Police Car
        {
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}



Re: [HELP]OnPlayerStateChange[HELP] - M0HAMMAD - 07.11.2014

if(newstate == PLAYER_STATE_DRIVER)