SA-MP Forums Archive
cannot show textdraw over another! - 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: cannot show textdraw over another! (/showthread.php?tid=646596)



cannot show textdraw over another! - AmirHossaiN - 19.12.2017

Hi guyz.

I want to show a textdraw (previewmodel) on another textdraw (text), but i cant.

I tried create previwmodel after my text textdraw.




Re: cannot show textdraw over another! - jasperschellekens - 19.12.2017

Just show the preview model at the end of everything, first show the text and then the preview model.


Re: cannot show textdraw over another! - AmirHossaiN - 19.12.2017

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Just show the preview model at the end of everything, first show the text and then the preview model.
i tried this but it didnt work


Re: cannot show textdraw over another! - jasperschellekens - 19.12.2017

Quote:
Originally Posted by AmirHossaiN
Посмотреть сообщение
i tried this but it didnt work
Add a timer which adds the preview model after a few seconds


Re: cannot show textdraw over another! - AmirHossaiN - 19.12.2017

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Add a timer which adds the preview model after a few seconds
it didnt work yet (


Re: cannot show textdraw over another! - NaS - 20.12.2017

Make sure that the sprite is created after the other TextDraw (not neccessarily shown later).

If nothing works (sometimes the order is tricky to get right with sprites), use a PlayerTextDraw for the hat, that will always show it above a regular TextDraw (however that is not the ideal solution since a global TextDraw is appropriate for TextDraws that are shown to everybody).


Re: cannot show textdraw over another! - AmirHossaiN - 20.12.2017

Quote:
Originally Posted by NaS
Посмотреть сообщение
Make sure that the sprite is created after the other TextDraw (not neccessarily shown later).

If nothing works (sometimes the order is tricky to get right with sprites), use a PlayerTextDraw for the hat, that will always show it above a regular TextDraw (however that is not the ideal solution since a global TextDraw is appropriate for TextDraws that are shown to everybody).
i tried both, but didnt work!!!!!!!!!!


Re: cannot show textdraw over another! - TomRedlake - 20.12.2017

Hello,

Have you maybe tried to place previewmodel textdraw to load after the name textdraw?
I mean it in way you create textdraws (under OnGamemodeInit) like this here

Because It doesnt matter when you will show your textdraw, the thing that matters is when you create textdraws.


EDIT: Nevermind, I saw NaS posted same thing like me...


Re: cannot show textdraw over another! - AmirHossaiN - 20.12.2017

Quote:
Originally Posted by TomRedlake
Посмотреть сообщение
Hello,

Have you maybe tried to place previewmodel textdraw to load after the name textdraw?
I mean it in way you create textdraws (under OnGamemodeInit) like this here

Because It doesnt matter when you will show your textdraw, the thing that matters is when you create textdraws.


EDIT: Nevermind, I saw NaS posted same thing like me...
my example code:

PHP код:
OnGameModeInit:
Name CreateTextDraw(...)
SantaHat CreateTextDraw(...)
OnPlayerSpawn:
TextDrawShowForPlayer(playeridName);
TextDrawShowForPlayer(playeridSantaHat); 
but Name textdraw is over than Santahat


Re: cannot show textdraw over another! - NaS - 20.12.2017

Did you also try to make the Hat a PlayerTextDraw?

I have a sprite in my script similar to this (a regular textdraw showing text and a playertextdraw sprite), which works.

You could also try to create other TextDraws before both of them (just for testing).