Help with TextDraw?
#1

I just got back in scripting, and I need some help.
I wanna make so when I type a command, a textdraw box with some text in it appears.
And then, when the player presses "LMB" ( left mouse button ) the box, text closes.
Here is my script that I done , and doesn't work. If you can please fix it for me.

Код:
new Text:rules;
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/rules", cmdtext, true, 10) == 0)
 	{
        TextDrawCreate(320, 240, "xD");
		TextDrawFont(rules, 2);
		TextDrawLetterSize(rules, 0.7, 4.9);
		TextDrawColor(rules, 0xB90000FF);
		TextDrawSetOutline(rules , 0);
		TextDrawSetProportional(rules , 1);
		TextDrawSetShadow(rules , 1);
		TextDrawUseBox(rules,1);
		TextDrawBoxColor(rules, 0x000000FF);
		TextDrawTextSize(rules, 0, 0);
		return 1;
	}
	return 0;
}
Thank you.
Reply
#2

God, I'm such a big idiot.
I got it. I just had to put the script in OnGamemodeInit, and then on Cmd with TextDrawShowForPlayer.
For those who had the same problem , here is the solution :

Код:
new Text:rules;
Код:
public OnGameModeInit()
{
 	rules =TextDrawCreate(320, 240, "xD");
	TextDrawFont(rules, 2);
	TextDrawLetterSize(rules, 0.7, 4.9);
	TextDrawColor(rules, 0xB90000FF);
	TextDrawSetOutline(rules , 0);
	TextDrawSetProportional(rules , 1);
	TextDrawSetShadow(rules , 1);
	TextDrawUseBox(rules,1);
	TextDrawBoxColor(rules, 0x000000FF);
	TextDrawTextSize(rules, 0, 0);
	return 1;
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/rules", cmdtext, true, 10) == 0)
 	{
		TextDrawShowForPlayer(playerid, rules);
		return 1;
	}
	return 0;
}
But I still have one problem. How do I make it so when player clicks (LMB) it closes?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)