Please help, NPCTALK!!
#1

Whats wrong with this? the NPC doesnt reply to the text!!
http://pastebin.com/m63c609f4
thanks
when i say stupid bot etc.. he doesnt reply!
Reply
#2

You cant use SendChat in FilterScript or GameMode. You can use in only NPC script.

You cant use callback OnPlayerText in NPC script. Use OnPlayerText in FilterScript or GameMode and replace SendChat to SendPlayerMessageToAll.

Код:
public OnPlayerText(playerid, text[])
{
	if (strfind(text, "text") != -1)
  {
  	SendPlayerMessageToAll(gPlayerID("BotName"), "Bot text.");
  }
}

stock gPlayerID(const Name[])
{
	for(new i; i<MAX_PLAYERS; i++)
	{
	  if(IsPlayerConnected(i))
	  {
	    new pName[MAX_PLAYER_NAME];
	    GetPlayerName(i, pName, sizeof(pName));
	    if(strcmp(Name, pName, true) == 0)
	    {
	      return i;
	    }
	  }
	}
	return -1;
}
Reply
#3

tbh it started working

like it is
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)