MySQL spams when admin types /saveall
#1

Ok, This is what happens when you /saveall:
Код:
[16:46:33] (MySQL) Query: UPDATE players SET Health = '85.000000', Armour = '0.000000', Gamemaster = '6', Cash = '1000', Interior = 0, Skin = 147, Score = '10' WHERE ID = 6 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4 
[16:46:33] (MySQL) Query: UPDATE players SET Health = '0.000000', Armour = '0.000000', Gamemaster = '0', Cash = '0', Interior = 0, Skin = 0, Score = '0' WHERE ID = 0 | ResultID: 4
(and a TON more)
and here is my /saveall command.
pawn Код:
CMD:saveall(playerid, params[])
{
    new string[128];
    for(new i; i < MAX_PLAYERS; i++)
    {
         savePlayer(i);
    }
    format(string, sizeof(string), "All player stats have been saved!");
    SendClientMessageToAll(COLOR_YELLOW, string);
    return 1;
}
Reply
#2

Of course it spams, It is because you're saving for MAX_PLAYERS even if they aren't connected!

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
    {
         if(IsPlayerConnected(i)) savePlayer(i);
    }
Btw, If you want to momentarily stop the logs, just use the function mysql_log(0); before the loop, then re-enable it after the loop.
Reply
#3

pawn Код:
CMD:saveall(playerid, params[])
{
    new string[128];
    for(new i; i < MAX_PLAYERS; i++)
    {
    if(!IsPlayerConnected(i)) continue;
         savePlayer(i);
    }
    format(string, sizeof(string), "All player stats have been saved!");
    SendClientMessageToAll(COLOR_YELLOW, string);
    return 1;
}
Edit: damn that guy before me >.<
Reply
#4

Oh F*ck yes, thanks man<3
Reply
#5

Here's a small optimization:
pawn Код:
CMD:saveall(playerid, params[])
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
         savePlayer(i);
    }
    SendClientMessageToAll(COLOR_YELLOW, "All player stats have been saved!");
    return 1;
}
Reply
#6

True, haha.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)