SA-MP Forums Archive
TextDrawHide function not being called. - 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: TextDrawHide function not being called. (/showthread.php?tid=640946)



TextDrawHide function not being called. - Primes007 - 09.09.2017

I want the textdraws to hide when the timer reaches 30. In the code, all the statements are working correctly except
PHP код:
HideRSCaptureTD(playerid); 
I have used SendClientMessage to debug the problem but every other line gets excecuted except the line above.
ShowCapturedTD(playerid); works fine (Rechecked by SendClientMessage too)

Heres my code:
PHP код:
public GZCounter(playerid,GZName[])
{
    new 
Counter[6];
    if(!
strcmp(GZName,"RS",true))
    {
        if(
RSPaused == 0RSTimer++;
        
format(Counter,6,"%d/30",RSTimer);
        
TextDrawSetString(GZCapturingRS2,Counter);
        if(
RSTimer == 30)
        {
            
            
HideRSCaptureTD(playerid);
            
ShowCapturedTD(playerid);
            
RSTimer 0;
                    
KillTimer(GZTimerRS);
        }
    }
}
HideRSCaptureTD(playerid)
{
    
TextDrawHideForPlayer(playerid,GZCapturing0);
    
TextDrawHideForPlayer(playerid,GZCapturingRS1);
    
TextDrawHideForPlayer(playerid,GZCapturingRS2);
    
TextDrawHideForPlayer(playerid,GZPaused3);
    
SendClientMessage(playerid,white,"Hiding RS Capture TD");
    return 
1;




Re: TextDrawHide function not being called. - Meller - 09.09.2017

Where are you using SetTimerEx?


Re: TextDrawHide function not being called. - OneDay - 09.09.2017

SetTimerEx does not take strings


Re: TextDrawHide function not being called. - JasonRiggs - 09.09.2017

The
PHP код:
TextDrawHideForPlayer 
function's format is like that..

PHP код:
TextDrawHideForPlayer(playeridTextdraw(playerid)); 



Re: TextDrawHide function not being called. - Primes007 - 09.09.2017

Quote:
Originally Posted by Meller
Посмотреть сообщение
Where are you using SetTimerEx?
Im using the SetTimerEx after the Capture Textdraw starts showing. Its called every one second to updte the timer. When The timer reaches 30, the SetTimer is supposed to be killed and the textdraw is supposed to be hidden.


Re: TextDrawHide function not being called. - Primes007 - 09.09.2017

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
The
PHP код:
TextDrawHideForPlayer 
function's format is like that..

PHP код:
TextDrawHideForPlayer(playeridTextdraw(playerid)); 
I have made it as a global text draw.
And also the code which I have written works when I use HideRSCaptureTD(playerid) under a command and also under OnPlayerUpdate. But it doesnt work in just this scenario(in the Timer function).


Re: TextDrawHide function not being called. - Primes007 - 09.09.2017

Bump.