SA-MP Forums Archive
how to make a npc talk ? - 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: how to make a npc talk ? (/showthread.php?tid=336942)



how to make a npc talk ? - Lenshy - 24.04.2012

Hello everyone, i have created a npc but i want make him talk.

How to proceed ?


Re: how to make a npc talk ? - Whizion - 24.04.2012

You could use:

https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer

And attach the source of sound to the position of the NPC.


Re : how to make a npc talk ? - Lenshy - 24.04.2012

I want him to speak no play music


(im french sorry for my bad english ^^)


Re: how to make a npc talk ? - RollTi - 24.04.2012

use SendChat then use a format string

like

pawn Код:
new string[128], npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, MAX_PLAYER_NAME);
if(!strcmp(npcpname, "YourNPCName", true))
{
    format(string, 128, "%s: Your word here!", npcname);
    SendClientMessageToAll(-1, string);
}



Re: how to make a npc talk ? - Marco_Valentine - 24.04.2012

SetPlayerChatBubble(playerid, "Hello i am a NPC", -1, 100.0, 10000);


Re: how to make a npc talk ? - faff - 24.04.2012

How to do this only if A player is is in a float 10z,x,y?

And send the message only to that playeR?