SA-MP Forums Archive
Textdraw string issue - 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 issue (/showthread.php?tid=482165)



Textdraw string issue - KingyKings - 19.12.2013

Hey,

So i want to make it so a textdraw will change everytime a play teleports to a new place so it doesn't spam chat.

I have come across an issue.
I created the text draw and thats fine, this is the command the player will type.

Код:
    if(strcmp(cmd, "/christmas", true) == 0)
	{
	    if(InDM[playerid] == 1)
 		{
			SendClientMessage(playerid, COLOR_RED, "Please type /leavedm first!");
 			return 1;
		}
		else
		{
     		        new teleport1[200], name[200];
  			GetPlayerName(playerid, name, 24);
     		        format(teleport1, 128, "%s Has Teleported To /christmas ", name);
     		        TextDrawSetString(Text:teleports, teleport1);
			SetPlayerPos(playerid, 260.8745,2897.3154,9.6477);
			return 1;
		}
	}
However when the player types /christmas it just removes the textdraw all together. Im not sure if i'm missing anything but i want the text draw to update for all players.

Thanks.


Re: Textdraw string issue - [EnErGyS]KING - 19.12.2013

Hello KingyKings,
Hide before changing string and then show ? Don't use 200


Re: Textdraw string issue - iOxide - 19.12.2013

Create your textdraw in the following way

new TextDraw[MAX_PLAYERS]; Then add TextDraw[playerid] instead of only TextDraw, for example

TextDraw[playerid] = TextDrawCreate(x,y, "Test");
TextDrawFont(TextDraw[playerid], 2); and so on.

So use the same thing for the string, TextDrawSetString(TextDraw[playerid], Text);