Strange problem with GameTextForPlayer
#1

I have a strange problem with gametextforplayer.
When i set the time. doesn't matter if i put 100 ms or 1000ms but it will last for about 10 seconds.
What is causing this?
Im using it in a countdown timer.

code:
PHP код:
public CharacterSelectionDelayTimer(playerid)
{
    new 
str[75];
    if(
CSDTseconds[playerid] >= 1)
    {
        
CSDTseconds[playerid]--;
        
format(strsizeof(str), "~w~Changing character in  ~g~ %d ~w~ seconds."CSDTseconds[playerid]);
         
GameTextForPlayer(playeridstr10001);
    } else {
        
KillTimer(CSDTtimer[playerid]);
        
CSDTtimer2[playerid] = 1;
        
SelectCharacterProceed(playeridCHARID[playerid]);
    }

The problem is not related to the timer but to gametextforplayer because CSDTseconds[playerid] gets updated every second
Reply
#2

new str[128];

Try
Reply
#3

https://sampwiki.blast.hk/wiki/GameTextStyle

You are setting the gametext style to 1 which lasts for 8 seconds regardless of time set.

So better change it to another style, style 3 for example.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)