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

pawn Код:
new playerState = GetPlayerState(killerid); // Get the killer's state
    if (playerState == PLAYER_STATE_PASSENGER ) // If the killer was in a vehicle,alright. What about and there were no drivers in it?
    {
    if(DoesVehicleHaveDriver(vehicleid)) return 0;
    }
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;
}
Код:
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(3588) : error 017: undefined symbol "vehicleid"
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(3617) : warning 217: loose indentation
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(3618) : warning 217: loose indentation
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(9245) : error 017: undefined symbol "foreach"
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(9245) : error 029: invalid expression, assumed zero
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(9245) : error 017: undefined symbol "i"
C:\Users\Tamer\Desktop\pwn\AVT scripting\gamemodes\GameMode.pwn(9245) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
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)