Textdraw string - 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)
+--- Thread: Textdraw string (
/showthread.php?tid=466745)
Textdraw string -
dominik523 - 29.09.2013
Hey! I got a strange problem with my textdraw. I have created a textdraw which shows to a player when he typed command for any animation. String of the textdraw is "SPACE to stop animation", but when I write in game, for example /sit command, I got textdraw with text "/REPORT". I don't have any textdraw created which contains text /report and I really don't know why is this happening.This is the code:
pawn Код:
new Text:txtAnimHelper;
.
.
.
txtAnimHelper = TextDrawCreate(610.0, 400.0, "~r~SPACE ~w~to stop the animation");
TextDrawUseBox(txtAnimHelper, 0);
TextDrawFont(txtAnimHelper, 2);
TextDrawSetShadow(txtAnimHelper,0);
TextDrawSetOutline(txtAnimHelper,1);
TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
TextDrawColor(txtAnimHelper,0xFFFFFFFF);
TextDrawAlignment(txtAnimHelper,3);
Can somebody help me because I tried everything, but I can't fix my problem. Thank you.
Re: Textdraw string -
Konstantinos - 29.09.2013
These inside OnGameModeInit
pawn Код:
txtAnimHelper = TextDrawCreate(610.0, 400.0, "~r~SPACE ~w~to stop the animation");
TextDrawUseBox(txtAnimHelper, 0);
TextDrawFont(txtAnimHelper, 2);
TextDrawSetShadow(txtAnimHelper,0);
TextDrawSetOutline(txtAnimHelper,1);
TextDrawBackgroundColor(txtAnimHelper,0x000000FF);
TextDrawColor(txtAnimHelper,0xFFFFFFFF);
TextDrawAlignment(txtAnimHelper,3);
When they type a command for animation:
pawn Код:
TextDrawShowForPlayer(playerid, txtAnimHelper);
Re: Textdraw string -
dominik523 - 29.09.2013
I got all that, textdraw is created under OnGamemodeInit, and its shown to a player when he uses command for any animation.
Re: Textdraw string -
Konstantinos - 29.09.2013
Well if you want to be 100 percent sure that it will show that message, then do:
pawn Код:
TextDrawSetString(txtAnimHelper, "~r~SPACE ~w~to stop the animation");
TextDrawShowForPlayer(playerid, txtAnimHelper);
whenever a player uses an animation command.
Re: Textdraw string -
dominik523 - 29.09.2013
Thanks, it works now.