SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/09/2017, 04:07 PM   #1
Amit1998
Huge Clucker
 
Join Date: Sep 2013
Posts: 242
Reputation: 4
Default Textdraws

Hello,
I've got several questions regarding TextDraws.

1. In my server, at some point, all of the textdraws go missing. I'm not sure what causes this. I'm pretty sure you guys cant know either from my description, but could it be because I hide the textdraws instead of destroying them?

For example this is my code:
PlayerTemp[playerid][Test] = TextDrawCreate(463.333404, 25.318511, "Test");
and then when the player wants it gone, I use TextDrawHide, and once a player uses the CMD again it just creates a new Textdraw in the same variable instead of showing the hidden one? Could this be creating mass textdraws that eventually go off the samp limits and causes the bug?


2. My background overrides the main HUD(the one that includes the HP, AP and Cash) how can I push it backwards so that the cash/money/armour will be visible to the user?


Tips?
Thanks!
__________________
+REP me if I helped you !
Amit1998 is offline   Reply With Quote
Old 13/09/2017, 04:24 PM   #2
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 780
Reputation: 47
Default Re: Textdraws

Show us how do you show and hide them, make sure that you are using TextDrawShow and TextDrawHide tho, and add the textdraw creating stuff under OnPlayerConnect.
__________________
JasonRiggs is offline   Reply With Quote
Old 13/09/2017, 04:37 PM   #3
Amit1998
Huge Clucker
 
Join Date: Sep 2013
Posts: 242
Reputation: 4
Default Re: Textdraws

Quote:
Originally Posted by JasonRiggs View Post
Show us how do you show and hide them, make sure that you are using TextDrawShow and TextDrawHide tho, and add the textdraw creating stuff under OnPlayerConnect.
I think I handled the issue, but do you know how can I push the background backwards so it'll show the hud?
__________________
+REP me if I helped you !
Amit1998 is offline   Reply With Quote
Old 13/09/2017, 04:41 PM   #4
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,083
Reputation: 2655
Default Re: Textdraws

Do you also destroy the textdraw when the player disconnects? PlayerTextDraw is automatically destroyed on disconnect, regular TextDraw is NOT. I think you're hitting the limit which prevents any further textdraw from being created.
__________________
Vince is offline   Reply With Quote
Old 13/09/2017, 04:50 PM   #5
Paulice
Huge Clucker
 
Join Date: Jul 2017
Posts: 424
Reputation: 44
Default Re: Textdraws

He's using global textdraws as per-player ones.
Paulice is offline   Reply With Quote
Old 13/09/2017, 05:02 PM   #6
Amit1998
Huge Clucker
 
Join Date: Sep 2013
Posts: 242
Reputation: 4
Default Re: Textdraws

Quote:
Originally Posted by Vince View Post
Do you also destroy the textdraw when the player disconnects? PlayerTextDraw is automatically destroyed on disconnect, regular TextDraw is NOT. I think you're hitting the limit which prevents any further textdraw from being created.
Yeah, thats what I thought.
I fixed it minutes after I posted this topic. However, the problem where the textdraw is above the main hud still exists(the textdraw has a black background and it hides the cash/ap/hp hud)
How can I fix it?
__________________
+REP me if I helped you !
Amit1998 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Textdraws tips (GTA V Textdraws...) adri1 Filterscripts 28 02/01/2018 02:24 AM
Global textdraws or player textdraws? Dreyfuz Scripting Help 3 08/08/2015 10:13 AM
Global TextDraws on top of Player TextDraws [resolved] Joe Staff Scripting Help 0 17/05/2013 06:35 AM
[BUG] Selecting textdraws lighting up multiple textdraws Hiddos Scripting Help 3 24/03/2012 03:44 PM


All times are GMT. The time now is 07:09 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.