Oldcar and newcar ID
#1

I got this so far:
pawn Код:
new lastvehicle[MAX_PLAYERS];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        lastvehicle[playerid] = GetPlayerVehicleID(playerid);
    }
    return 1;
}
Now my problem, I don't know how to check if new vehicleid matches the old one on OnPlayerStateChange, any ideas?
Basically I want to terminate a mission etc if vehicle ids arent matching.
Reply
#2

pawn Код:
if(lastvehicle[playerid] != GetPlayerVehicleID(playerid))
{
    //terminate
}
Reply
#3

Ah thanks, didnt think of using != :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)