TextDraw
#1

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?
Reply
#2

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);
Reply
#3

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...
Reply
#4

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)