#1

Hello,
i have question.

Is OnPlayerDisconnect called when the server restart? (SendRconCommand - GMX)
because i heard that there is some issue that Player Stats aren't saving when the server is restarting.
Reply
#2

Player Stats don't save when server restarts MANUALLY via the host / in-game, its normal..
Which means that you need to script a command such as
/savestats to save everybody's status before GMX
Or just Script a /gmx command with timers,
Reply
#3

is it possible to do this calling OnPlayerDisconnect?

pawn Код:
CMD:gmx(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return
        SendClientMessage(playerid, -1, "You are not rcon admin");
    foreach(Player, i)
    {
       OnPlayerDisconnect(i, 1); //1 means - Leaving
    }
    SendRconCommand("gmx");
    return 1;
}
EDIT:

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Yeah i got this issue too.GMX doesn't save the players statst,even if you place the saving variables in "OnGameModeExit".
Before doing GMX,kick all players and do it.So the players stats are saved.
i wouldn't do this.

is there any other way
Reply
#4

Yeah i got this issue too.GMX doesn't save the players statst,even if you place the saving variables in "OnGameModeExit".
Before doing GMX,kick all players and do it.So the players stats are saved.
Reply
#5

I wouldn't do your way Logitech, i know there is another way to save the stats instead kicking all the players.
because my command /kickall has anti-kick-higher administrator
Reply
#6

Do what Aira said then,script a /savestats command with a loop,which can be used only by admins,to save all the players stats currently online,then gmx.
Reply
#7

Quote:
Originally Posted by Romel
Посмотреть сообщение
I wouldn't do your way Logitech, i know there is another way to save the stats instead kicking all the players.
because my command /kickall has anti-kick-higher administrator
Try this

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
if(!strcmp(cmdtext, "/gmx", true))
    {
        if (PlayerInfo[playerid][pAdmin] >= 1338)
        {
        GameTextForPlayer(i, "SERVER RESTARTING IN: ~n~~r~ 15 ~w~ SECONDS", 2500, 3);
/*
Save your shits here
*/

        SendClientMessage(playerid, COLOR_GREY," Saving Files - Restarting in 15 SECONDS");
        SetTimerEx("GMXSave", 10000, false, "i", playerid);
        }
        else return SendClientMessage(playerid, COLOR_GREY,"Bitch Please, only Aira may access this command");
        return 1;
    }
pawn Код:
forward GMXSave(playerid);
public GMXSave(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        GameTextForPlayer(i, "SERVER RESTARTING IN: ~n~~r~ FIVE ~w~ SECONDS", 2500, 3);
        SetTimerEx("GMXSave2", 6000, false, "i", playerid);
    }
    return 1;
}

forward GMXSave2(playerid);
public GMXSave2(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        GameTextForPlayer(i, "~g~SERVER RESTARTING", 2500, 3);
        SendRconCommand("gmx");
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by Aira
Посмотреть сообщение
Try this
//
Badly scripted,why you're using two timers and 2 loops?That's abnormal.
Reply
#9

that would be great idea but still is the method i post above is going to work?
Reply
#10

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Badly scripted,why you're using two timers and 2 loops?That's abnormal.
Thank you, why don't you script it for him next time?

Quote:
Originally Posted by Romel
Посмотреть сообщение
that would be great idea but still is the method i post above is going to work?
Make a command ot save eveRything
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)