Name above NPC
#4

Showing ID next to the name:

Код:
public OnPlayerConnect(playerid)
{
	if(IsPlayerNPC(playerid))
	{
		new npcname[MAX_PLAYER_NAME];
		new NameTagString[32];
		GetPlayerName(playerid, npcname, sizeof(npcname));
		format(NameTagString, sizeof(NameTagString), "%s (%d)", npcname, playerid);
		
		new Text3D: NPC_NameTag;
		NPC_NameTag = Create3DTextLabel(NameTagString,0xFFFFFFFF,0.0,0.0,0.0,20,0,1);
		Attach3DTextLabelToPlayer(NPC_NameTag, playerid, 0.0, 0.0, 1.0);
	}
	return 1;
}


Setting the draw distance:

Quote:

NPC_NameTag = Create3DTextLabel(NameTagString,0xFFFFFFFF,0.0,0.0 ,0.0,20,0,1);

Change the red number to anything else.
Reply


Messages In This Thread
Name above NPC - by CAR - 11.11.2009, 18:27
Re: Name above NPC - by Gergo1352 - 11.11.2009, 18:35
Re: Name above NPC - by CAR - 11.11.2009, 18:59
Re: Name above NPC - by Gergo1352 - 11.11.2009, 19:05
Re: Name above NPC - by CAR - 11.11.2009, 19:09
Re: Name above NPC - by Gergo1352 - 11.11.2009, 19:11
Re: Name above NPC - by CAR - 11.11.2009, 19:14
Re: Name above NPC - by Gergo1352 - 11.11.2009, 19:20
Re: Name above NPC - by CAR - 11.11.2009, 19:23
Re: Name above NPC - by cyber_punk - 11.11.2009, 19:24

Forum Jump:


Users browsing this thread: 2 Guest(s)