Putting players names above there heads ?
#1

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 :/
Reply
#2

Here's a filterscript I made, either paste it into your gamemode or compile it & loadfs.

pawn Код:
#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;
}
Reply
#3

Didn't seem to work but thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)