SA-MP Forums Archive
OnplayerLeavesVehicule = DestroyVehicule - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnplayerLeavesVehicule = DestroyVehicule (/showthread.php?tid=410453)



OnplayerLeavesVehicule = DestroyVehicule - RiChArD_A - 25.01.2013

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


Re: OnplayerLeavesVehicule = DestroyVehicule - DrDoom151 - 25.01.2013

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;
}



Re: OnplayerLeavesVehicule = DestroyVehicule - MP2 - 25.01.2013

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


Re: OnplayerLeavesVehicule = DestroyVehicule - Roach_ - 25.01.2013

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

forward _DestroyVehicle(vehicleid);
public _DestroyVehicle(vehicleid) return DestroyVehicle(vehicleid);



Respuesta: Re: OnplayerLeavesVehicule = DestroyVehicule - RiChArD_A - 25.01.2013

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?


Re: OnplayerLeavesVehicule = DestroyVehicule - DrDoom151 - 25.01.2013

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


Respuesta: OnplayerLeavesVehicule = DestroyVehicule - RiChArD_A - 25.01.2013

WORKING PERFECT THANKS!