Putting NPC Name over their head
#1

How to put NPC Name over their head? i need this please help me
Reply
#2

Just type in your gamemode
pawn Код:
public OnGameModeInit()
{
        ConnectNPC("Your NPC NAME HERE","pilot"); // Npc name there
    return 1;
}
Check it out too - https://sampwiki.blast.hk/wiki/ConnectNPC
Reply
#3

thats not what i mean. i mean is how to put their name over there head.
Reply
#4

pawn Код:
#include <a_samp>

new Text3D:BotName;

public OnGameModeInit()
{
    BotName = Create3DTextLabel("[bot name here]",0xFFFFFFFF,0.0,0.0,0.0,30.0,0,0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new name[24];
        GetPlayerName(playerid,name,24);
        if(!strcmp(name,"[bot name here]",true)) Attach3DTextLabelToPlayer(BotName,playerid,0.0,0.0,0.5);
    }
    return 1;
}
Should work. Also this is only if you have one NPC. If you have more of them make sure you create many more 3D Text Variables.
Reply
#5

pawn Код:
new Text3D:Your3DName = Create3DTextLabel("My Cool NPC", YOUR_COLOR_HERE, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(Your3DName, playerid, 0.0, 0.0, 0.7);
This is the best position (use it myself)!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)