need help with vehicles
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        if (GetPlayerVehicleID(playerid) == masina)
        {
            // player entered that vehicle..
        }
    }
    return 1;
}
This checks if the player enters a vehicle as driver or passenger and if the vehicleid is the one masina holds. If you want to check only for driver, change:
pawn Код:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
to:
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
This one checks if the player is in that vehicle which can be used anywhere else.
pawn Код:
if (IsPlayerInVehicle(playerid, masina))
{
    // player is in that vehicle..
}
Reply


Messages In This Thread
need help with vehicles - by karolis11234 - 19.02.2014, 15:53
Re: need help with vehicles - by Konstantinos - 19.02.2014, 15:59

Forum Jump:


Users browsing this thread: 4 Guest(s)