SA-MP Forums Archive
Need some help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need some help (/showthread.php?tid=208830)



Need some help - dawidek11 - 09.01.2011

How can I destroy a vehicle if it is not used, if someone will get in to it and if will exit it a vehicle will destroy after 3 mins. there must be killtimer if the timer is running and someone will get into vehicle which has a timer with destroy option.

Plese help.

Thanks


Re: Need some help - XoX - 09.01.2011

AddStaticVehicleEx
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
So for 3 Minutes you have to set 180 as respawn delay


Re: Need some help - bhaveshnande - 09.01.2011

Well instead of the 'timer', why don't u use AddStaticVehiceEx ?
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx


You can use this function to add vehicles to your gamemode. This function can only create vehicles in the OnGameModeInit callback, and vehicles created with this function cannot be removed. Check CreateVehicle if you are interested in creating vehicles during game-runtime.


Re: Need some help - dawidek11 - 09.01.2011

i need to use createvehice because I am using it as vehicle spawner
so i can't use AddStaticVehicleEx because it respawns vehicle and doesn't delete it


Re: Need some help - Infamous - 09.01.2011

I would suggest you create a variable which is set to 1 OnPLayerExitVehicle. Create a timer OnGameModeInIt and within the timers public check the variables status 0 or 1. If 1 destroy the vehicle and reset the variable.