How to check if there is a driver in the car or not?
#3

Something like this would work:

pawn Код:
stock DoesVehicleHaveDriver(vehicleid)
{
    #if defined foreach
    foreach(new i : Player)
    #else
    for(new i = 0; i < MAX_PLAYERS; i++)
    #endif 
    {
        if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return true;
    }
    return false;
}
Reply


Messages In This Thread
How to check if there is a driver in the car or not? - by Tamer - 23.02.2013, 20:29
Re: How to check if there is a driver in the car or not? - by Misiur - 23.02.2013, 20:34
Re: How to check if there is a driver in the car or not? - by Scenario - 23.02.2013, 20:37
Re: How to check if there is a driver in the car or not? - by Tamer - 24.02.2013, 06:35
Re: How to check if there is a driver in the car or not? - by Scenario - 24.02.2013, 06:47
Re: How to check if there is a driver in the car or not? - by Tamer - 24.02.2013, 06:51

Forum Jump:


Users browsing this thread: 1 Guest(s)