Timer bug
#1

Hey all. I have a countdown timer but it should only run for one person only.
When two persons are in the countdown it gets bugged.

pawn Код:
jacktimer = SetTimerEx("jcounting",1000,true,"i",playerid);
pawn Код:
public jcounting(playerid)
{
    Bit16_Set(jcount,playerid,Bit16_Get(jcount,playerid) -1);
    if(Bit16_Get(jcount,playerid) <1)
    {
    TextDrawHideForPlayer(playerid,Textdraw7);
    TextDrawHideForPlayer(playerid,Textdraw8);
    KillTimer(jacktimer);
    }
    format(String, sizeof(String), "%i", Bit16_Get(jcount,playerid));
    TextDrawSetString(Textdraw8,String);
    return 1;
}
First I see his count, then I see my count. It's flashing
Reply
#2

pawn Код:
//top
new jacktimer[MAX_PLAYERS];
//wherever you use it
jacktimer[playerid] = SetTimerEx("jcounting",1000,true,"i",playerid);

public jcounting(playerid)
{
    Bit16_Set(jcount,playerid,Bit16_Get(jcount,playerid) -1);
    if(Bit16_Get(jcount,playerid) <1)
    {
    TextDrawHideForPlayer(playerid,Textdraw7);
    TextDrawHideForPlayer(playerid,Textdraw8);
    KillTimer(jacktimer[playerid]);
    }
    format(String, sizeof(String), "%i", Bit16_Get(jcount,playerid));
    TextDrawSetString(Textdraw8,String);
    return 1;
}
This should fix problem. Have fun
Reply
#3

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
pawn Код:
//top
new jacktimer[MAX_PLAYERS];
//wherever you use it
jacktimer[playerid] = SetTimerEx("jcounting",1000,true,"i",playerid);

public jcounting(playerid)
{
    Bit16_Set(jcount,playerid,Bit16_Get(jcount,playerid) -1);
    if(Bit16_Get(jcount,playerid) <1)
    {
    TextDrawHideForPlayer(playerid,Textdraw7);
    TextDrawHideForPlayer(playerid,Textdraw8);
    KillTimer(jacktimer[playerid]);
    }
    format(String, sizeof(String), "%i", Bit16_Get(jcount,playerid));
    TextDrawSetString(Textdraw8,String);
    return 1;
}
This should fix problem. Have fun
I love you<3 thanks +rep
Reply
#4

No Problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)