26.06.2013, 05:24
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;
}