10.07.2017, 19:09
pawn Код:
CMD:gmx(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
new reason[128], time, query[128];
if(AdminLevel[playerid] < 3) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "ds[128]", time, reason)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /gmx [time till restart] [reason]");
if(time < 1 ||time > 60) return SendClientMessage(playerid, COLOUR_GREY, "Time must be between 1 minute and 1 hour.");
format(reason, sizeof(reason), "Admin %s has scheduled a Server Restart in %d minute(s) [Reason: %s]", GetNameEx(playerid), time, reason);
SendClientMessageToAll(0x95FFB4FF, reason);
//kick all
for(new x = 1; x < GetVehiclePoolSize()+1; x++)
{
UpdateVehicleParts(x);
}
foreach(Player, i)
{
SavePlayerData(i);
}
for(new x = 1; x < MAX_BUSINESSES; x++)
{
if(BizEntX[x] != 0)
{
format(query, sizeof(query), "UPDATE `businesses` SET BizBank = %d WHERE id = %d", BizBank[x], x);
mysql_tquery(dbHandle, query,"", "");
}
}
GMXTIME = time;
return 1;
}
None of those functions call anything apart from MYSQL.
pawn Код:
if(GMXTIME > 0)
{
GMXTIME --;
if(GMXTIME == 0)
{
SetPlayerName(p, MAName[p]);
SendClientMessage(p,COLOUR_WHITE, "Server Restart Initiated.");
GameModeExit();
}
else
{
new string1[128];
format(string1, sizeof(string1), "(( Reminder: Server will restart in %d minute(s). (Leave the server to avoid losing items.) ))", GMXTIME);
SendClientMessage(p, COLOUR_WHITE, string1);
}
}