SA-MP Forums Archive
Textdraw countdown problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw countdown problem (/showthread.php?tid=197894)



Textdraw countdown problem - BlackWolf120 - 10.12.2010

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;
}



Re: Textdraw countdown problem - Lynn - 10.12.2010

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;
}



Re: Textdraw countdown problem - BlackWolf120 - 10.12.2010

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


Re: Textdraw countdown problem - Lynn - 10.12.2010

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


Re: Textdraw countdown problem - BlackWolf120 - 10.12.2010

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


Re: Textdraw countdown problem - veyron - 10.12.2010

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)