Robbing Mall Help [Timers] - 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: Robbing Mall Help [Timers] (
/showthread.php?tid=278913)
Robbing Mall Help [Timers] -
BigAl - 24.08.2011
Right, I need help making this...
when I enter the checkpoint, and restart the server, the server restarts but there's no gamemode, and once I have entered the checkpoint once, and even when i restart the server... the server restarts again after 30 seconds, can anyone help me please...
pawn Code:
forward disable(playerid);
public disable(playerid)
{
SendRconCommand("gmx");
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid, "~r~ The raiders won! Server restarting...",5000, 5);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(gTeam[playerid] == RAIDERS)
{
new string[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s (ID:%d) is now robbing the bank! Kill him", pname);
SendClientMessageToAll(COLOR_RED, string);
GameTextForPlayer(playerid, "~r~robbing the mall, stay in checkpoint for 30 seconds", 5000, 5);
SetTimer("disable", 30000, true);
}
return 1;
}
Re: Robbing Mall Help [Timers] -
=WoR=G4M3Ov3r - 24.08.2011
remove this
PHP Code:
SendRconCommand("gmx");
Why are you retarting the server, after they rob something ?
and change true to false
pawn Code:
SetTimer("disable", 30000, false);
// Set a timer of 30000 miliseconds (3 Minutes)
https://sampwiki.blast.hk/wiki/SetTimer
Re: Robbing Mall Help [Timers] -
Wesley221 - 24.08.2011
pawn Code:
SetTimer("disable", 30000, true);
This timer will repeat all the time. Im not sure if this gets resetted after a GMX, so just do it like this
pawn Code:
SetTimer("disable", 30000, false);