Efficient Vehicle Looping
#21

An easy way to do this is the following, no need for loops or anything:

* Create an area and attach it to the vehicle.
* Set the streamer item EXTRA_ID value to the vehicle id.
* Detect OnPlayerEnterDynamicArea and obtain the EXTRA_ID value from the area id (that would be the vehicle id).
* Create some array or some variable and assign the vehicle ID to it. (Something like PlayerClosestVehicle)
* Detect OnPlayerLeaveDynamicArea, detect if its a vehicle area and remove it from the variable/array you created previously.


However, you would need Incognito's Streamer functions to achieve this.

I currently use this method for everything, and I don't face any lag or RAM usage problems. (If you need an example code for it PM me, I'm not home right now).
Reply


Messages In This Thread
Efficient Vehicle Looping - by MP2 - 05.05.2015, 08:56
Re: Efficient Vehicle Looping - by AIped - 05.05.2015, 09:08
Re: Efficient Vehicle Looping - by MicroD - 05.05.2015, 09:22
Re: Efficient Vehicle Looping - by Tamer - 05.05.2015, 09:43
Re: Efficient Vehicle Looping - by MP2 - 05.05.2015, 09:54
Re: Efficient Vehicle Looping - by Tamer - 05.05.2015, 10:00
Re: Efficient Vehicle Looping - by Misiur - 05.05.2015, 10:01
Re: Efficient Vehicle Looping - by Lordzy - 05.05.2015, 10:10
Re: Efficient Vehicle Looping - by MP2 - 05.05.2015, 10:29
Re: Efficient Vehicle Looping - by Konstantinos - 05.05.2015, 10:38
Re: Efficient Vehicle Looping - by MP2 - 05.05.2015, 10:51
Re: Efficient Vehicle Looping - by Kar - 05.05.2015, 21:28
Re: Efficient Vehicle Looping - by Emmet_ - 05.05.2015, 21:45
Re: Efficient Vehicle Looping - by Crayder - 05.05.2015, 21:59
Re: Efficient Vehicle Looping - by MP2 - 06.05.2015, 10:22
Re: Efficient Vehicle Looping - by AndreT - 06.05.2015, 11:51
Re: Efficient Vehicle Looping - by Mauzen - 06.05.2015, 13:31
Re: Efficient Vehicle Looping - by sammp - 06.05.2015, 14:57
Re: Efficient Vehicle Looping - by Tamer - 06.05.2015, 17:57
Re: Efficient Vehicle Looping - by AndreT - 06.05.2015, 19:31
Re: Efficient Vehicle Looping - by Marricio - 08.05.2015, 21:22
Re: Efficient Vehicle Looping - by Pottus - 09.05.2015, 01:39

Forum Jump:


Users browsing this thread: 1 Guest(s)