SA-MP Forums Archive
rcon exit - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: rcon exit (/showthread.php?tid=288015)



rcon exit - beckzy - 05.10.2011

When you close the server with rcon "exit" OnPlayerDisconnect isn't called for players.


Re: rcon exit - steki. - 06.10.2011

Look at your signature.


Re: rcon exit - Emmet_ - 06.10.2011

Maybe use:

pawn Код:
new
    x;
while (x<500) {
    if (x!=(0xFFFF)) {
        CallRemoteFunction("OnPlayerDisconnect", "i", x);
    }
    ++ x;
}



Re: rcon exit - beckzy - 06.10.2011

It is still a bug and that is why I reported it!


Re: rcon exit - Emmet_ - 06.10.2011

I'm not sure if it's supposed to call OnPlayerDisconnect, as it's meant to shut the server down (like you're doing maintenance). It's the same as cmd.exe. If you type 'exit' in the console, it will close. Happens with SA:MP servers too. However, you can try this:

pawn Код:
public OnGameModeExit() {
    new x;
    while (x<500) {
        if (x!=(0xFFFF)) {
            CallRemoteFunction("OnPlayerDisconnect", "i", x);
        }
        ++ x;
    }
}
It will call OnPlayerDisconnect when the callback is called (it's called on rcon gmx, rcon exit)...


Re: rcon exit - beckzy - 06.10.2011

OnPlayerDisconnect is already called on gmx so using that would call it twice for each player.


Re: rcon exit - [HiC]TheKiller - 06.10.2011

The rcon exit function kills the console, so it's not actually going to call anything after that. It's the same concept if you just press close on the server console. As Emmet said, you can easily script a way around this.


Re: rcon exit - leong124 - 07.10.2011

https://sampforum.blast.hk/showthread.php?tid=250369
Yeah.