Please help, NPCTALK!!
#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


Messages In This Thread
Please help, NPCTALK!! - by patchkinson - 27.11.2009, 17:36
Re: Please help, NPCTALK!! - by DaKill - 27.11.2009, 17:49
Re: Please help, NPCTALK!! - by patchkinson - 27.11.2009, 18:49

Forum Jump:


Users browsing this thread: 1 Guest(s)