OnplayerLeavesVehicule = DestroyVehicule
#1

What can I do so that when a player leaves a vehicle it destroys after 30 seconds. Thank you
Reply
#2

I think this should work. If not I assume you'd have to make a global variable and pass that to the Timer (DestroyVehicle).

Код:
forward DestroyVehicle;

public OnPlayerExitVehicle(playerid, vehicleid)
{
	SetTimerEx("DestroyVehicle", 30000, false, "i", vehicleid);
	return 1;
}

public DestroyVehicle(vehicleid)
{
       DestroyVehicle(vehicleid);
	return 1;
}
Reply
#3

CreateVehicle and AddStaticVehicleEx both have respawn_delay parameters. This value is the respawn delay (duh) in seconds. When the vehicle is un-occupied it will re-spawn after the delay. You can delete re-spawned vehicles using OnVehicleSpawn(vehicleid).
Reply
#4

Try this:
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    SetTimerEx("_DestroyVehicle", 30000, false, "i", vehicleid);
    return 1;
}

forward _DestroyVehicle(vehicleid);
public _DestroyVehicle(vehicleid) return DestroyVehicle(vehicleid);
Reply
#5

Quote:
Originally Posted by Roach_
Посмотреть сообщение
Try this:
pawn Код:
forward _DestroyVehicle(vehicleid);
public _DestroyVehicle(vehicleid) return DestroyVehicle(vehicleid);
Where on may GM do I place this?
Reply
#6

Quote:
Originally Posted by Lauder
Посмотреть сообщение
Where on may GM do I place this?
Anywhere. I always place timers on the bottom of my script.
Reply
#7

WORKING PERFECT THANKS!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)