NPC 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 name (
/showthread.php?tid=611181)
NPC name -
Owen007 - 03.07.2016
Hi everyone i need some help i want to know how can i display a npc name i tried a lot searching but nothing worked i also read a tuttorial of samp to how to add a npc name but that didnt worked for me can someone other help.
Re: NPC name -
Konstantinos - 03.07.2016
As a name tag? Create and attach a 3D text label to the NPC when first spawned.
Re: NPC name -
Owen007 - 03.07.2016
Quote:
Originally Posted by Konstantinos
As a name tag? Create and attach a 3D text label to the NPC when first spawned.
|
can u give some code example?
Re: NPC name -
Konstantinos - 03.07.2016
Quote:
Originally Posted by Owen007
can u give some code example?
|
In OnPlayerSpawn, check if the player is NPC and if its name is the bot you connected (see here:
https://sampforum.blast.hk/showthread.php?tid=95034) and just create and attach. An example of both functions can be seen here:
https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer
All you have to do is replace the text and color.
Re: NPC name -
Owen007 - 03.07.2016
Quote:
Originally Posted by Konstantinos
|
but i have 4 vehicle driving bots i mean u saying to add a 3d label to player but how can i add it to a specific npc
Re: NPC name -
Spmn - 03.07.2016
Attach3DTextLabelToPlayer
Re: NPC name -
Konstantinos - 03.07.2016
Quote:
Originally Posted by Owen007
but i have 4 vehicle driving bots i mean u saying to add a 3d label to player but how can i add it to a specific npc
|
The tutorial I linked you specifically shows that you check the name of the NPC before putting it in the created vehicle. That is where you should create and attach the 3D text label, along with
PutPlayerInVehicle function.