SA-MP Forums Archive
Force Save On Kick - 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: Force Save On Kick (/showthread.php?tid=311316)



Force Save On Kick - Abreezy - 16.01.2012

How can you force a save while you use kick(playerid) ? I have SavePlayer(playerid); under most stuff, including the kick command, but it still goes for onplayerdisconnect therefore saving everything again, which sets it to 0, since player is already kicked i guess.

How could you fix this issue? it's the same issue with the gmx.


Re: Force Save On Kick - [ABK]Antonio - 16.01.2012

OnPlayerDisconnect is always called...case 2 of onplayerdisconnect is kicked/banned, you could do something with that...I'm not sure what you're trying to do though since saving when they disconnect should always happen unless you change it...like...

pawn Код:
new str[128];
switch(reason)
{
    case 0: format(str, sizeof(str), "{00CCCC}Leave:{993300} %s[%d] has left the server! (Timeout)", Name(playerid), playerid, reason);
    case 1: format(str, sizeof(str), "{00CCCC}Leave:{993300} %s[%d] has left the server! (Leaving)", Name(playerid), playerid, reason);
    case 2:
    {
        //we can do some stuff if you need
    }
}