SA-MP Forums Archive
Strange problem with GameTextForPlayer - 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)
+--- Thread: Strange problem with GameTextForPlayer (/showthread.php?tid=652811)



Strange problem with GameTextForPlayer - jasperschellekens - 19.04.2018

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


Re: Strange problem with GameTextForPlayer - UFF - 19.04.2018

new str[128];

Try


Re: Strange problem with GameTextForPlayer - FailerZ - 19.04.2018

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.