SA-MP Forums Archive
TextDraw - 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 (/showthread.php?tid=152120)



TextDraw - Infinity - 02.06.2010

When using this code for my textdraw:
Code:
OnGameModeInit:
format(string, sizeof(string),"~w~%s  ]  By: %s  ]  Time left: %d:%d ", MisName, Author,RoundTimeMin, RoundTimeSec);
	Textdraw0 = TextDrawCreate(26.000000, 435.000000, "_");
	TextDrawBackgroundColor(Textdraw0, 255);
	TextDrawFont(Textdraw0, 2);
	TextDrawLetterSize(Textdraw0, 0.500000, 1.200000);
	TextDrawColor(Textdraw0, 16711935);
	TextDrawSetOutline(Textdraw0, 0);
	TextDrawSetProportional(Textdraw0, 1);
	TextDrawSetShadow(Textdraw0, 1);
	TextDrawUseBox(Textdraw0, 1);
	TextDrawBoxColor(Textdraw0, 255);
	TextDrawTextSize(Textdraw0, 609.000000, 5.000000);
	
	TextDrawSetString(Textdraw0,string);
	TextDrawShowForAll(Textdraw0);

OnPlayerConnect:
    TextDrawShowForPlayer(playerid, Textdraw0);
I get this:
http://ft.fckitupload.com/yI/samp405.png
(The black box on the bottom).


The problem seems to be the string, but what's wrong with it?


Re: TextDraw - MastahServers - 02.06.2010

The string is the problem.

Add on the top in GameModeInIt:
pawn Code:
welcomeText = TextDrawCreate(240.0,580.0,"Welcome to [name-server]");
And in OnPlayerConnect

pawn Code:
TextDrawShowForPlayer(playerid,welcomeText);



Re: TextDraw - Infinity - 02.06.2010

If you would ahve read what I've said, you would have seen that I know the string is the problem, but I still need the string...


Re: TextDraw - Infinity - 02.06.2010

Sorry for the bump, but i really can't figure out what the problem is.


Re: TextDraw - [NYRP]Mike. - 02.06.2010

pawn Code:
TextDrawCreate(26.000000, 435.000000, "_");
'_' is equal to ' ' meaning that it'll create the box unless it has valid text in it...


Re: TextDraw - Infinity - 02.06.2010

Quote:
Originally Posted by »Shadow™«
pawn Code:
TextDrawCreate(26.000000, 435.000000, "_");
'_' is equal to ' ' meaning that it'll create the box unless it has valid text in it...
Since you cant enter trings in it directly (for as far as I know) people often use this method for inserting strings.
First they create an empty box, and then they enter the string into it. The problem is that although the string works, the box stays empty.