Formatting
#3

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


Messages In This Thread
Need help with this - by HondaCBR - 28.12.2011, 23:51
Re: Formatting - by HondaCBR - 29.12.2011, 07:49
Re: Formatting - by Seven_of_Nine - 29.12.2011, 08:26
Re: Formatting - by HondaCBR - 29.12.2011, 08:59
Re: Formatting - by Seven_of_Nine - 29.12.2011, 09:08

Forum Jump:


Users browsing this thread: 1 Guest(s)