Problem with rob timer
#1

Hello,in my robbery gametext timer i've this small check:

Top of gm.
pawn Код:
new IsRobbing[MAX_PLAYERS];
In the rob timer:

pawn Код:
IsRobbing[playerid] =1;
IsRobbing = 1 means the player started robbing.

When a player finish robbery:

pawn Код:
IsRobbing[playerid] =0;
But here is the problem.It's onplayerdeath,i made if player was robbing and will be killed or he will die,the gametext timer will stop.But dont work,the timer keeps countding down until the robbery finish.

pawn Код:
if(IsRobbing[playerid] == 1)
    {
    new string2[128];
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string2, sizeof(string2), "You died and your robbery failed! NOOB.");
    SendClientMessage(playerid,red,string2);
    GameTextForPlayer(playerid, "Robbery ~r~FAILED.", 3000, 5);
    IsRobbing[playerid] =0;
    pRobCount[playerid] = 0;
    }
What's wrong?I wanna stop the gametext timer and stop robbery if the player die.
Reply
#2

Hey!

You gotta use
pawn Код:
KillTimer(NAME_TIMER[playerid]);
Reply
#3

:O Right,forget it,thanks!
Reply
#4

Did it work?

Hope I could help!
Reply
#5

Yes it worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)