NPC's name - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: NPC's name (
/showthread.php?tid=358434)
NPC's name -
Crazyboobs - 10.07.2012
How can i make a npcs name? when npc is walking it should show the name of the npc over the head.
Re: NPC's name -
clarencecuzz - 10.07.2012
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'.
Re: NPC's name -
Crazyboobs - 10.07.2012
I did but it says Bob has joined the server and not showing the name over his head.
Re: NPC's name -
clarencecuzz - 10.07.2012
Do you have
somewhere in your OnGameModeInit() or OnFilterScriptInit() ??
Re: NPC's name -
Crazyboobs - 10.07.2012
yes
Re: NPC's name -
clarencecuzz - 10.07.2012
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;
}