Need help with this -
HondaCBR - 28.12.2011
Im using 3d text name tags:
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);
}
How can I reformat the name text when you type a command, for example /afk
pawn Code:
if(strcmp(cmd, "/afk", true) == 0)
{
}
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]);
Re: Formatting -
HondaCBR - 29.12.2011
I really need this done, does any one know how to do this?
Re: Formatting -
Seven_of_Nine - 29.12.2011
You need to global the players label.
pawn Code:
new Text3D:pTextID[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
new nameformat[30];
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]);
pTextID[playerid] = Create3DTextLabel(nameformat,COLOR_WHITE,X,Y,Z+0.13,15,0,0);
Update3DTextLabelText(pTextID[playerid],COLOR_WHITE,nameformat);
Attach3DTextLabelToPlayer(pTextID[playerid], playerid, 0.0, 0.0, 0.13);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/afk", cmdtext, true, 10) == 0)
{
new
nameformat[30],
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(nameformat,sizeof(nameformat),"%s (%d, %dh) | AFK",pName,playerid,PlayerInfo[playerid][pH]);
Update3DTextLabelToText(pText[playerid],COLOR_WHITE,nameformat);
return 1;
}
return 0;
}
; )
Re: Formatting -
HondaCBR - 29.12.2011
pawn Code:
Update3DTextLabelToText(pText[playerid],COLOR_WHITE,nameformat);
Code:
D:\map.pwn(480) : error 017: undefined symbol "Update3DTextLabelToText"
D:\map.pwn(480) : warning 215: expression has no effect
D:\map.pwn(480) : error 001: expected token: ";", but found "]"
D:\map.pwn(480) : error 029: invalid expression, assumed zero
D:\map.pwn(480) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Formatting -
Seven_of_Nine - 29.12.2011
Can't you just correct yourself, seriously?
pawn Code:
Update3DTextLabelText(pText[playerid],COLOR_WHITE,nameformat);