View Single Post
Old 11/12/2016, 10:47 AM   #12
BiosMarcel
Banned
 
Join Date: Jul 2012
Location: Germany
Posts: 1,219
Reputation: 234
Default Re: Performance Question , Per Player Timer vs Timer that loops through all players

Quote:
Originally Posted by cessil View Post
pretty sure 99.9% of forum users are amateurs in scripting for sa-mp
performance wise it the different timers won't matter, the only slow down I could foresee is the writing method, but since its every x seconds you should be fine. (I also looked at your github)
you could also do without timers and use OnPlayerUpdate and check the last time you saved position and if it was longer than 2 seconds, save the position.
I fail to see why you're saving positions without a timestamp, if it's to recreate data that has happened then a timestamp would be extremely important.

If it is to recreate someones footsteps for example to see if they are cheating, then you could just save x,y,z,t,v
where xyz is position, t is time and v is vehicle, then I'd run a macro and convert the data to create objects to view in the sa-mp map editor or create 3DTexts to view in game
I am saving the timestamp

PHP Code:
format(logData150"%s %s's Location X: %f | Y: %f | Z: %f\r\n\n"getDateAndTime(), nameXYZ); 
"getDateAndTime()" creates a timestamp

Also, i think onPlayerUpdate is being called very often, esspecially when a player is moving it is called very often
BiosMarcel is offline   Reply With Quote