03.03.2011, 16:55
I created some vehicles with the CreateVehicle command and they respawn. That's good. Now, if a player leaves a vehicle, i want the vehicle to be deleted after 15 seconds. Is it possible
CreateVehicle(458,2076.7231,1656.9888,10.6719,177.5046,0,0,(Time how long to respawn);
CreateVehicle(458,2076.7231,1656.9888,10.6719,177.5046,0,0,-1); // -1 means that it wont respawn change it to set respawn time.
public OnPlayerExitVehicle( playerid, vehicleid )
{
SetTimerEx( "PlsDeleteVehicle", 15000, 0, "d", vehicleid );
return true;
}
forward PlsDeleteVehicle( vehicleid );
public PlsDeleteVehicle( vehicleid )
{
DestroyVehicle( vehicleid );
return true;
}
CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 15);//last param respawn time in seconds.