MySQL save while Kick/Ban
#1

Hello guys, can u please help me with my problem?

Using MySQL for saving stats, everythinks work fine while normal disconnect, but when i call Kick or Ban player, his account didnt save (save with 0 value). Any solutions?
Reply
#2

Actually, I have an idea. Delay the ban/kick and save the player data before kick/ban.
Reply
#3

hmmm try to "UPDATE" or "INSERT INTO" banned database, everytime you ban the player. Actually this method its very safe than saving ban data every player disconnect
Reply
#4

Why not try to, Make a timer when the player will be kicked or banned, before that save the call save account
Reply
#5

Maybe this can solved
Code:
new kickuser;
CMD:kick(playerid, params[])
{
    if(params != INVALID_PLAYER_ID || params != playerid)
    {
        if(sscanf(params, "i", kickuser)){
            //Your save Callback or Code
            SetTimerEx("KickUser",10000,0,"i",kickuser); //10 Second is better with callback
        }
     }
     return 1;
}
forward KickUser(kickuser);
public KickUser(kickuser)
{
     Kick(kickuser);
     return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)