Robbing Mall Help [Timers]
#1

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;
}
Reply
#2

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
Reply
#3

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)