04.08.2016, 15:55
Hey.
Made a very simple textdraw using a textdraw editor. I'm trying to find out how it works, and was wondering how it works with text that is "dynamic". For instance I have made a stock called ServerMSG which basically will print SERVER: %s. So when I use it I just write ServerMSG(playerid, "message here"); right.
How could I print that text in a textdraw? I'm a bit confused. So this is what I exported from the textdraw editor - by the way, are these [0]'s after [playerid] needed? I assume it is textdraw IDs, but if you name them uniquely will it be a problem without that ID? Here's my textdraw:
My stock:
That didn't work out well.. not sure how it is supposed to be. Any tips?
Made a very simple textdraw using a textdraw editor. I'm trying to find out how it works, and was wondering how it works with text that is "dynamic". For instance I have made a stock called ServerMSG which basically will print SERVER: %s. So when I use it I just write ServerMSG(playerid, "message here"); right.
How could I print that text in a textdraw? I'm a bit confused. So this is what I exported from the textdraw editor - by the way, are these [0]'s after [playerid] needed? I assume it is textdraw IDs, but if you name them uniquely will it be a problem without that ID? Here's my textdraw:
Код:
MSGTextdraw[playerid][0] = CreatePlayerTextDraw(playerid, 357.333526, 423.126220, "SERVER: %s"); PlayerTextDrawLetterSize(playerid, MSGTextdraw[playerid][0], 0.400000, 1.600000); PlayerTextDrawAlignment(playerid, MSGTextdraw[playerid][0], 2); PlayerTextDrawColor(playerid, MSGTextdraw[playerid][0], -1); PlayerTextDrawSetShadow(playerid, MSGTextdraw[playerid][0], 0); PlayerTextDrawSetOutline(playerid, MSGTextdraw[playerid][0], 0); PlayerTextDrawBackgroundColor(playerid, MSGTextdraw[playerid][0], 255); PlayerTextDrawFont(playerid, MSGTextdraw[playerid][0], 1); PlayerTextDrawSetProportional(playerid, MSGTextdraw[playerid][0], 1); PlayerTextDrawSetShadow(playerid, MSGTextdraw[playerid][0], 0);
Код:
stock ServerMSG(playerid, message[]) { format(msg, sizeof(msg), "[SERVER]:{FFFFFF} %s", message); ServerMSG[playerid] = CreatePlayerTextDraw(playerid, 357.333526, 423.126220, msg); TextDrawShowForPlayer(playerid, MSGTextdraw:msg); PlayerTextDrawShow(playerid, ServerMSG[playerid]); }