SA-MP Forums Archive
current number of vehicles in server - 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: current number of vehicles in server (/showthread.php?tid=275081)



current number of vehicles in server - Yourfatness - 08.08.2011

i have a script that deletes vehicles when they are destroyed. after a while, there would be a noticable drop in the number of vehicles in the server. i would like to make a warning to tell me when there is less than 500 vehicles in the server so i can spawn more, but i dont know how to count the current number of vehicles in the server. i don't want to use a loop that checks every vehicle id because that would kill my processor, so if anyone else has a different way to get this number then that would be great.
if not, i will try it my way lol
thank you


Re: current number of vehicles in server - [L3th4l] - 08.08.2011

OGM create the vehicles, loop through all of them and store the count in a variable. When a vehicle is destroyed, set the variable -1 and check if(Variable < 500), then send the message to the owner/or we


Re: current number of vehicles in server - Yourfatness - 08.08.2011

that's a really good idea. thank you. it was right in front of me the whole time, i guess i just needed someone to point it out lol