16.07.2012, 13:41
each time i try to use either strcmp or strfind in either OnClientMessage or OnPlayerText callback in NPC script the npc crashes
for example :
when i chat hi bot the bot should answer me , but it dont answer and crashes ( leave server )
same happens when i use strfind or strcmp in OnClientMessage or in OnPlayerText
so the bot crashes when it tries to read any text
any one can help me ??
for example :
pawn Код:
public OnPlayerText(playerid, text[])
{
if (strfind(text, "Hey Bot") != -1)
{
new string[80], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Hey %s", name);
SendChat(string);
}
return 1;
}
same happens when i use strfind or strcmp in OnClientMessage or in OnPlayerText
so the bot crashes when it tries to read any text
any one can help me ??