31.10.2011, 16:48
Hello, I have
a timer and when the driver exit the vehicle, the vehicle will be destroy.
The problem is, that if the driver exit vehicle, and there are passenger in the vehicle, the vehicle still destroyed.
How can I make it, so when the driver exit vehicle, to check if there are passenger in the vehicle. If not the car will be destroyed, if else there are passengers in the vehicle to wait all passenger exit vehicle and then destroyed.
pawn Код:
OnPlayerExitVehicle(playerid, vehicleid)
The problem is, that if the driver exit vehicle, and there are passenger in the vehicle, the vehicle still destroyed.
How can I make it, so when the driver exit vehicle, to check if there are passenger in the vehicle. If not the car will be destroyed, if else there are passengers in the vehicle to wait all passenger exit vehicle and then destroyed.
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER) {
DestroyVehicle(vehicleid);
}
SetTimerEx("cardestroyedhide", 5000, 0, "i", vehicleid);//
}