SA-MP Forums Archive
MySQL spams when admin types /saveall - 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: MySQL spams when admin types /saveall (/showthread.php?tid=357531)



MySQL spams when admin types /saveall - Elysian` - 07.07.2012

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;
}



Re: MySQL spams when admin types /saveall - coole210 - 07.07.2012

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.


Re: MySQL spams when admin types /saveall - FireCat - 07.07.2012

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 >.<


Re: MySQL spams when admin types /saveall - Elysian` - 07.07.2012

Oh F*ck yes, thanks man<3


Re: MySQL spams when admin types /saveall - FireCat - 07.07.2012

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;
}



Re: MySQL spams when admin types /saveall - Elysian` - 07.07.2012

True, haha.