19.05.2016, 03:06
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.
Would the code above do the trick or does it save all the players online at the same time?
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.
pawn Код:
foreach(Player, i)
{
if(IsPlayerConnected(i)) OnPlayerSave(i);
}