Textdraw string issue
#1

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)