SA-MP Forums Archive
Performance questions - 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: Performance questions (/showthread.php?tid=331275)



Performance questions (+rep) - Universal - 04.04.2012

Hi everyone, so today I was wondering which way should I choose to make it less lag-causing or maybe theres no difference? Lets say I start the server and OnGameModeInit I load all of the vehicles and assign the data into enum, but I dont spawn the vehicle. When player connects it loops through the loaded vehicles which are assigned into an enum and spawns if the player is the owner of the current vehicle. The other way would be, load the vehicle (which means, read the file, assign the data into enums and spawn it) each time the player connects. The same goes with the vehicle saving... Saving vehicle upon GameModeExit, and or OnPlayerDisconnect.

Can I get some advice? Thanks!