GMX Set Time 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: GMX Set Time Help (
/showthread.php?tid=328217)
GMX Set Time Help -
BrokinJesus - 24.03.2012
Код:
command(gmx, playerid, params[])
{
new reason[128];
if(sscanf(params, "z", reason)) {
if(Player[playerid][AdminLevel] >= 6) {
SendClientMessage(playerid, WHITE, "Server: /gmx [reason]");
}
}
else {
if(Player[playerid][AdminLevel] >= 6) {
if(CurGMX == 0) {
GMXPrep(playerid, reason);
}
else {
SendClientMessage(playerid, WHITE, "There already is a current GMX in execution.");
}
}
}
return 1;
}
I am wondering how I can add or change the timer for this so it can be set between two set times.
Ex: /gmx [time] [reason]
Ex: /gmx 10(in minutes) Updates
Would anyone know how I could go about doing this?
Re: GMX Set Time Help -
Tanush123 - 24.03.2012
pawn Код:
CMD:gmx(playerid,params[])
{
new str[128],seconds;
if(Player[playerid][AdminLevel] < 6) return 0;//this will show unknown command for under lvl 6
if(sscanf(params,"ds[50]",seconds,reason)) return SCM(playerid,grey,"USAGE: /gmx [seconds] [reason]");
format(str,sizeof(str),"Server is going to restart in %d seconds. Reason: %s",seconds,reason);
SendClientMessageToAll(-1,str);
SetTimer("Restart",seconds*1000,0);
return 1;
}
forward Restart();
public Restart()
{
SendRconCommand("gmx");
return 1;
}