SA-MP Forums Archive
Get passenger? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Get passenger? (/showthread.php?tid=208482)



Get passenger? - ajwar - 08.01.2011

Hi, how to check passengers variable (spec == 7) in OnPlayerstateChange? I tryed something like that..

pawn Code:
if(model == 545)
        {
             if(spec == 7)
            {
                        if (playerState == PLAYER_STATE_PASSENGER || playerState == PLAYER_STATE_DRIVER)
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                    if(IsPlayerInAnyVehicle(i))
                    {
                        return 1;
            }

            return 1;
        }



Re: Get passenger? - Ash. - 08.01.2011

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_PASSENGER) //Check for passenger state
    {
        if(spec == 7)
        {
            //Your player is a passenger and there "spec" is 7
        }
    }
    return 1;
}