Textdraw countdown problem
#1

hi,
could someone explain to me why the first code is workin and the second not?
Only the texdraw text has been changed.
But still only the first code is working.
(this is a textdraw countdown: that one that is not working => the seconds after the writing are not changing.)

pawn Код:
public countTimer()  //working
{
    new textformat[32];
    format(textformat,sizeof textformat,"Countdown : %d",countdown);
    TextDrawSetString(textdraw,textformat);      
    if(--countdown == 0){
    KillTimer(counttimer);
    GameTextForPlayer(...);
    countdown = 0;
    }
    return 1;
}


public countTimer() //not working
{
    new textformat[32];
    format(textformat,sizeof textformat,"~l~!! ~r~Detonating: %d ~l~!!",countdown);
    TextDrawSetString(textdraw,textformat);      
    if(--countdown == 0){
    KillTimer(counttimer);
    GameTextForPlayer(...);
    countdown = 0;
    }
    return 1;
}
Reply
#2

Don't use the same public etc. for 2 different things.
pawn Код:
public countTimer2() //not working
{
    new textformat[32];
    format(textformat,sizeof textformat,"~l~!! ~r~Detonating: %d ~l~!!",countdown);
    TextDrawSetString(textdraw,textformat);      
    if(--countdown == 0){
    KillTimer(counttimer2);
    GameTextForPlayer(...);
    countdown = 0;
    }
    return 1;
}
Reply
#3

im not using both of this countdowns in my script, only one.

but it doesnt work anymore since ive edited the text that shall appear in the texdraw
Reply
#4

Try removing the all the extra stuff, like l, !!, etc. And only use,
Detonating: %d
and see if it works.
Reply
#5

also doesnt work.
it might be the string?
the 32
has that something to do with the lenght or the amount of letters?
Reply
#6

String lenght shows how many characters can it contain, so proably its the cause, just raise it and it should work fine.
Edit
Noticed that sizeof textformat should be sizeof(textformat)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)