NPC's name
#1

How can i make a npcs name? when npc is walking it should show the name of the npc over the head.
Reply
#2

This function is given in:
pawn Код:
ConnectNPC(name[], script[]);
name[] = Put this as your NPC's name, example: ConnectNPC("Bob", "Myscript");

You will have to record an NPC script with the npc_record filterscript in order to have a scriptname. Or you can use some of the recordings in 'npcmodes'.
Reply
#3

I did but it says Bob has joined the server and not showing the name over his head.
Reply
#4

Do you have
pawn Код:
ShowNameTags(1);
somewhere in your OnGameModeInit() or OnFilterScriptInit() ??
Reply
#5

yes
pawn Код:
ShowNameTags(1);
Reply
#6

pawn Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) {
    new Text3D:label = Create3DTextLabel("Bob", 0xFFFFFFFF, 0.0, 0.0, -50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7); }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)