Textdraw disappearing - 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: Textdraw disappearing (
/showthread.php?tid=359619)
Textdraw disappearing -
Mean - 14.07.2012
SOLVED-
Re: Textdraw disappearing -
AndreT - 14.07.2012
Most likely because the code in the loop does not fit the conditions of "fps2 > 1 && fps2 < 100 && fps2 > -1050" therefore the array "str" does not contain anything and TextDrawSetString is called with an empty string. I do not know what method you use to determine the player's FPS, so I cannot help you too much about that.
However I can help you fix your loop which is not the best at the moment.
1. a clever GetPlayerState check eliminates the need for a IsPlayerConnected check.
2. set the textdraw string only if the conditionals above are met.
Re: Textdraw disappearing -
Mean - 14.07.2012
You've just made my brain move.
if(fps2 > 1 && fps2 < 100 &&
fps2 > -1050)
That's the issue since the get-FPS method isn't 100% reliable, thanks!
I found out that I actually don't need the whole check because one is below. It's like my brain was totally paused when I was scripting that.