NPC crash when it tries to read text
#1

each time i try to use either strcmp or strfind in either OnClientMessage or OnPlayerText callback in NPC script the npc crashes

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;
}
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 ??
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)