Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Saving player stats on restart

$
0
0
I was wondering if a foreach statement would efficiently work on saving player stats by ID using threaded queries. Like for example, there are 20 players online and once an admin uses rcon command to restart, it'll save each player by ID. Something like...

Player ID 1 saved then goes to Player ID 2 and saves until it reaches the last player ID online. And after all players are saved, it saves the server stats or dynamics, like houses, businesses, etc., it then triggers the "gmx" after everything is saved.

Code:

foreach(Player, i)
{
        if(IsPlayerConnected(i)) OnPlayerSave(i);
}


Would the code above do the trick or does it save all the players online at the same time?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>