08.05.2015, 21:22
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).
* 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).