Textdraw issue
#1

I got a issue here with textdraws which i cant wrap my head around. Haven't been using textdraws before so might be a beginner mistake but i dont belive so.

Basiclly, need to create a set of textdraw for a function and currently working on creating the textdraws.

Код:
new Text:box[MAX_PLAYERS];
new Text:texxt[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
	box[playerid] = TextDrawCreate(140.0,580.0,"_");
	TextDrawUseBox(box[playerid], 1);
	TextDrawBoxColor(box[playerid], 0x000000AA);
	texxt[playerid] = TextDrawCreate(140.0,580.0,"Welcome to my SA-MP server");
	TextDrawColor(texxt[playerid],COLOR_WHITE);
	TextDrawTextSize(texxt[playerid], 2.0, 3.6);
	return 1;
}

COMMAND:join(playerid, params[])
{
	OnPlayerConnect(playerid);
	return 1;
}

COMMAND:textdraw(playerid, params[])
{
	TextDrawShowForPlayer(playerid, box[playerid]);
	TextDrawShowForPlayer(playerid, texxt[playerid]);
	return 1;
}
Above is the current code. The textdraw is supposed to be created when a player connects. The command /join is to simulate connecting to the textdraws creates (they are destroyed with OnFilterScriptExit on a filterscript reload) and /textdraw is supposed to show the textdraws.

My problem is, no textdraws is showing up at all. Both me and another person is getting the same result when trying.

Am i overlooking something, or is the textdraw feature simply bugged?
Reply
#2

Why are you creating the textdraw on connect ?

Why not OnFilterScriptInit
Reply
#3

The colors you use are not the ones required for the text-draws, you will have to get the hex ones such as this color..

pawn Код:
-16711681
Reply
#4

Quote:
Originally Posted by Glint
Посмотреть сообщение
Why are you creating the textdraw on connect ?

Why not OnFilterScriptInit
Tried it aswell, same result.

Quote:
Originally Posted by Randy More
Посмотреть сообщение
The colors you use are not the ones required for the text-draws, you will have to get the hex ones such as this color..

pawn Код:
-16711681
Are you sure? Checking the wiki (https://sampwiki.blast.hk/wiki/TextDrawUseBox), i'm doing it correct.

Nevertheless, tried your suggestion, didnt work.
Reply
#5

What did you use to get the coordinates of the textdraw ? Are you sure they are correct ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)