Killing a timer
#2

You have "robtimer" set as a public function. KillTimer expects a timer ID. You need to make a separate variable (should be global) for the timer itself. For example, in your robbank command:

pawn Код:
//at the top of the script
new banktimer;

CMD:robbank(playerid, params[]) {
//all your other stuff
banktimer = SetTimer("robtimer", 300000, false);
}

public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 3, 2144.2012,1640.6323,993.5761))
    {
        if(GetPlayerHealth(playerid) <20) return SendClientMessage(playerid, COLOR_WHITE, "You have less than 20hp, bank robbery cancelled!"); //I am receiving the warning on this line
        TogglePlayerControllable(playerid, 1);
        KillTimer(banktimer);
    }
    return 1;
}
Reply


Messages In This Thread
Killing a timer - by Josh_Main - 26.06.2013, 05:17
Re: Killing a timer - by Alternative112 - 26.06.2013, 05:24
Re: Killing a timer - by Josh_Main - 26.06.2013, 05:28
Re: Killing a timer - by Josh_Main - 26.06.2013, 05:52
Re: Killing a timer - by Cjgogo - 26.06.2013, 07:10
AW: Killing a timer - by Skimmer - 26.06.2013, 09:46

Forum Jump:


Users browsing this thread: 2 Guest(s)