Get passenger?
#1

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;
        }
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)