View Single Post
Old 15/07/2020, 01:07 PM   #6
algorhitmically
Little Clucker
 
Join Date: Feb 2020
Posts: 35
Reputation: 22
Default Re: No nametag id only

pawn Code:
#include <a_samp>

#define NAMETAG_DRAWDISTANCE (20)
#define NAMETAG_COLOR (0xFFFFFFFF)

new Text:pIDLabel[MAX_PLAYERS];

public OnGameModeInit()
{
    ShowNameTags(0);
}

public OnPlayerConnect(playerid)
{
    new text[7];
    format(text, sizeof text, "(%d)", playerid);
    pIDLabel[playerid] = Create3DTextLabel(text, NAMETAG_COLOR, 0, 0, 0, NAMETAG_DRAWDISTANCE, 0, 1);
    Attach3DTextLabelToPlayer(pIDLabel[playerid], playerid, 0.0, 0.0, 0.2);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    Delete3DTextLabel(pIDLabel[playerid]);
    pIDLabel[playerid] = INVALID_3DTEXT_ID;
    return 1;
}
algorhitmically is offline   Reply With Quote