How to make npcs talk?
#1

Hey i was just wondering how i make my npcs talk? i saw it on a server where the npc was talking and it appeared above its head.

Please hrlp

Thank You
Reply
#2

anyone know?
Reply
#3

To set text above player's head use https://sampwiki.blast.hk/wiki/SetPlayerChatBubble

You can use this function with your NPC.
Reply
#4

thanks but how do i fix this error error 017: undefined symbol "SetPlayerChatBubble"

and where do i put the code?
Reply
#5

Are you using SA-MP 0.3 includes?
Reply
#6

not sure but where do i add the code you told me? in my gm? npc pwn? and where inside the file? thanks
Reply
#7

Quote:
Originally Posted by Sampiscool123
not sure but where do i add the code you told me? in my gm? npc pwn? and where inside the file? thanks
In your gamemode script, where you want your NPC to talk.
Reply
#8

undefined symbol "text"

also how do i change what it says?

sorry im new to this thanks for helping
Reply
#9

For example:

pawn Код:
SetPlayerChatBubble(playerid, "Your Text Goes Here", 0xFF0000FF, 100.0, 10000);
Reply
#10

if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
SetPlayerChatBubble(playerid, "Your Text Goes Here", 0xFF0000FF, 100.0, 10000);
}
return 1;
}

The npc doesnt talk, any ideas?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)