28.12.2011, 23:51
(
Last edited by HondaCBR; 29/12/2011 at 07:49 AM.
)
Im using 3d text name tags:
How can I reformat the name text when you type a command, for example /afk
I want that command to change that original text from
format(razem,sizeof(razem),"%s (%d, %dh)",plname2,playerid,PlayerInfo[playerid][pH]);
to:
format(razem,sizeof(razem),"%s (%d, %dh)\n(AFK)",plname2,playerid,PlayerInfo[playerid][pH]);
pawn Code:
public OnPlayerSpawn(playerid)
{
new nameformat[30];
new Text3D:playertextid;
SetPlayerColor(playerid,COLOR_WHITE);
new plname2[MAX_PLAYER_NAME];
new Float:X, Float:Y, Float:Z;
GetPlayerName(playerid, plname2, sizeof(plname2));
GetPlayerPos(playerid,X,Y,Z);
format(nameformat,sizeof(nameformat),"%s (%d, %dh)",plname2,playerid,PlayerInfo[playerid][pH]);
playertextid = Create3DTextLabel(nameformat,COLOR_WHITE,X,Y,Z+0.13,15,0,0);
Update3DTextLabelText(playertextid,COLOR_WHITE,nameformat);
Attach3DTextLabelToPlayer(playertextid, playerid, 0.0, 0.0, 0.13);
}
pawn Code:
if(strcmp(cmd, "/afk", true) == 0)
{
}
format(razem,sizeof(razem),"%s (%d, %dh)",plname2,playerid,PlayerInfo[playerid][pH]);
to:
format(razem,sizeof(razem),"%s (%d, %dh)\n(AFK)",plname2,playerid,PlayerInfo[playerid][pH]);