SA-MP Forums Archive
Textdraw 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)
+--- Thread: Textdraw Problem (/showthread.php?tid=664335)



Textdraw Problem - NoteND - 25.02.2019

Hey!

I'm having a problem with Textdraw being shown without it being called in any way.

So basically, I made some global textdraws, wrote their code under "OnGameModeInit" and I got timer set to show them 5 seconds after players register/login's but they already show as soon as register/login screen appears.. Any fixes ?


Re: Textdraw Problem - Pottus - 25.02.2019

Lets see that timer and function which the timer calls.


Re: Textdraw Problem - NoteND - 25.02.2019

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Lets see that timer and function which the timer calls.
https://pastebin.com/GnsCYKRp


Re: Textdraw Problem - Pottus - 25.02.2019

Okay so the problem is likely inconsistent client load times or you set that timer at the wrong time (wrong callback?). You should look for a better time to activate this timer that gives better consistency.


Re: Textdraw Problem - NoteND - 25.02.2019

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Okay so the problem is likely inconsistent client load times or you set that timer at the wrong time (wrong callback?). You should look for a better time to activate this timer that gives better consistency.
Makes no sense to me tho, I'm calling timer after player registers/login, gonna try to call it some other time I guess


Re: Textdraw Problem - Pottus - 25.02.2019

Oh I know why duh! You need to save your timer to a variable and make sure that you kill the timer! Someone is disconnecting quick but that timer still runs for the next player connecting.


Re: Textdraw Problem - NoteND - 25.02.2019

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Oh I know why duh! You need to save your timer to a variable and make sure that you kill the timer! Someone is disconnecting quick but that timer still runs for the next player connecting.
Oh ye...

Totally forgot I made global timer.. Thanks


Re: Textdraw Problem - SymonClash - 25.02.2019

Actually, there is no need for the timer imho.

Just show the textdraw after the register/login message (if you have one), or if you don't, after setting all variables and similar.

Then hide it after they spawn or make them hide by pressing MMB or any key you wish.


Re: Textdraw Problem - NoteND - 25.02.2019

Quote:
Originally Posted by SymonClash
Посмотреть сообщение
Actually, there is no need for the timer imho.

Just show the textdraw after the register/login message (if you have one), or if you don't, after setting all variables and similar.

Then hide it after they spawn or make them hide by pressing MMB or any key you wish.
I made timer for a reason, since I use interpolatecamera for cinematic, and I want textdraws to show after camera stops moving.. and I couldnt find option like "OnCameraStopMoving" so I used timer.


Re: Textdraw Problem - SymonClash - 25.02.2019

Quote:
Originally Posted by NoteND
Посмотреть сообщение
I made timer for a reason, since I use interpolatecamera for cinematic, and I want textdraws to show after camera stops moving.. and I couldnt find option like "OnCameraStopMoving" so I used timer.
Well you never said about InterpolateCameraPos...