SA-MP Forums Archive
Game Mode Help! - 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: Game Mode Help! (/showthread.php?tid=653427)



Game Mode Help! - TadePoleMG - 04.05.2018

Hi guys

I'm running my hosted server with a script which start and end rounds. After Time is equal to 0 new gamemode started randomly(by SendRconCommand(command)) .

After every GamemodeExit A message show that - XYZ disconnected from server.
Can any tell me that how to make it like when gamemodeexit this message won't be done and when player quit as by yourself then this message would be done . Thank you.

Sorry for my bad english.

rep++.


Re: Game Mode Help! - kovac - 04.05.2018

I would do that in the following way;

PHP код:
new bool:IsRestarting// Create a new variable
// Under your command
IsRestarting true;
// OnPlayerDisconnect
if(!IsRestarting// We tell the script to only do the following if the server is not restarting
{
    new 
string[128];
    switch(
reason)
    {
         case 
0:format(stringsizeof(string), "%s timed out."GetName(playerid));
        case 
1:format(stringsizeof(string), "%s left."GetName(playerid));
        case 
2:format(stringsizeof(string), "%s kicked."GetName(playerid));
    }
    
SendClientMessageToAll(-1string);
}
// OnGameModeExit
IsRestarting false;
// function used:
stock GetName(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    return 
name;




Re: Game Mode Help! - TadePoleMG - 04.05.2018

It recieves tag mismatch warning under OnGameModeExit.
How to fix it.


Re: Game Mode Help! - TadePoleMG - 04.05.2018

Thank You it works
rep++;