06.04.2009, 13:18
Quote:
|
Originally Posted by Torekk
How to check if the player is the driver of the vehicle? I tried it with:
pawn Code:
|
Code:
// On top of your script:
new vehicle;
// In OnGameModeInit
vehicle = AddStaticVehicle(...)
// Outside other functions (most likely at the end of your script).
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new numero = GetPlayerVehicleID(playerid);
if(numero == vehicle)
{
// Do something here
}
}
return 1;
}

