SA-MP Forums Archive
textdraw keeps dissapearing.. any suggestions? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: textdraw keeps dissapearing.. any suggestions? (/showthread.php?tid=88038)



textdraw keeps dissapearing.. any suggestions? - chaosnz - 23.07.2009

Ok i got a textdraw in my gm advertising my website and for some reason it keeps dissapearing about a minute after i connect to my server, every single time.

This is what ive got

// TextDraws
new Text:Site;


Site = TextDrawCreate(1.000000,434.000000,"www.sargesworld.net");
TextDrawAlignment(Site,0);
TextDrawBackgroundColor(Site,0x00000099);
TextDrawFont(Site,1);
TextDrawLetterSize(Site,0.500000,1.500000);
TextDrawColor(Site,0xFFFFFFAA);
TextDrawSetOutline(Site,1);
TextDrawSetProportional(Site,1);
TextDrawSetShadow(Site,1);

The main body of the textdraw is in ongamemodeinit
And i have the following in onplayerconnect

TextDrawShowForPlayer(playerid,Site);

Any help would be greatly appreciated.



Re: textdraw keeps dissapearing.. any suggestions? - Annihalation - 23.07.2009

add a box around it, because your using the background color :/

that might help, if it doesn't, lemme know


Re: textdraw keeps dissapearing.. any suggestions? - M4S7ERMIND - 23.07.2009

if you have any other textdraw, where you are using TextDrawDestoy function.. TextDrawDestroy may cause it..
Something like real time made of textdraw.. understand?


Re: textdraw keeps dissapearing.. any suggestions? - Joe Staff - 23.07.2009

I believe Μαστερμινδ is correct. Look inside your gamemode for a timer that does TextDrawDestroy. When TextDrawDestroy tries to destroy a textdraw that doesn't exist (like one that's been previously deleted) it will delete the last made textdraw for reasons beyond me. You should include a variable for each textdraw to show weither or not the textdraw has been created, so you can do something like:

pawn Код:
if(textdrawtoggle==1)
{
  TextDrawDestroy(textdraw);
  textdrawtoggle=0;
}