Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
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.
Posts: 426
Threads: 46
Joined: Apr 2011
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,
Posts: 3,351
Threads: 780
Joined: Jan 2010
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.
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
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
Posts: 3,351
Threads: 780
Joined: Jan 2010
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.
Posts: 426
Threads: 46
Joined: Apr 2011
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;
}
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by Aira
Try this
//
|
Badly scripted,why you're using two timers and 2 loops?That's abnormal.
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
that would be great idea but still is the method i post above is going to work?
Posts: 426
Threads: 46
Joined: Apr 2011
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