18.12.2011, 06:04
Do I need a script to do this or is it already done its just I'm playing around with a lan server and my npc dont have there names above there heads :/
#include <a_samp>
new Text3D:NPC_Label[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid) && NPC_Label[playerid] == Text3D:INVALID_3DTEXT_ID)
{
new
playername[24],
Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerName(playerid, playername, 24);
NPC_Label[playerid] = Create3DTextLabel(playername, 0xFF6347FF, pos[0], pos[1], pos[2] + 0.9, 20.0, 0);
return 1;
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
if(IsPlayerNPC(playerid) && _:NPC_Label[playerid] != INVALID_3DTEXT_ID)
{
Delete3DTextLabel(NPC_Label[playerid]);
NPC_Label[playerid] = Text3D:INVALID_3DTEXT_ID;
return 1;
}
return 1;
}