How to make npcs talk? -
Sampiscool123 - 30.12.2009
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
Re: How to make npcs talk? -
Sampiscool123 - 30.12.2009
anyone know?
Re: How to make npcs talk? -
MadeMan - 30.12.2009
To set text above player's head use
https://sampwiki.blast.hk/wiki/SetPlayerChatBubble
You can use this function with your NPC.
Re: How to make npcs talk? -
Sampiscool123 - 30.12.2009
thanks but how do i fix this error error 017: undefined symbol "SetPlayerChatBubble"
and where do i put the code?
Re: How to make npcs talk? -
MadeMan - 30.12.2009
Are you using SA-MP 0.3 includes?
Re: How to make npcs talk? -
Sampiscool123 - 30.12.2009
not sure but where do i add the code you told me? in my gm? npc pwn? and where inside the file? thanks
Re: How to make npcs talk? -
MadeMan - 30.12.2009
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.
Re: How to make npcs talk? -
Sampiscool123 - 30.12.2009
undefined symbol "text"
also how do i change what it says?
sorry im new to this thanks for helping
Re: How to make npcs talk? -
MadeMan - 30.12.2009
For example:
pawn Код:
SetPlayerChatBubble(playerid, "Your Text Goes Here", 0xFF0000FF, 100.0, 10000);
Re: How to make npcs talk? -
Sampiscool123 - 30.12.2009
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?