Creating a bot system based on .txt file
#2

Not sure if you still need help with this lol, anyways try this:

pawn Код:
#if BOT_FEATURE == true
    ChatTimer = SetTimer("BotChat", 1000*60*1, true);
    #endif

    #if BOT_FEATURE == true
    if(fexist("JakAdmin/Config/botdialogue.txt"))
    {
        new File:dialogue;
        new str[256];
        dialogue = fopen("JakAdmin/Config/botdialogue.txt", io_read);
        while(fread(dialogue, str, sizeof(str), false))
        {
            new idx;
            strmid(Chats[ChatCount], str, 0, strlen(str)-1, 200);
            ChatCount++;
        }
        print("Bot Dialogue has been loaded!");
    }
    else
    {
        print("Bot Dialogue has not been loaded!");
    }
    #endif

#if BOT_FEATURE == true
forward BotChat();
public BotChat()
{
    if(ccount == sizeof(Chats)) ccount = 0;
    new str[256];
    format(str, sizeof(str), "%s: "white"%s", BOT_NAME, Chats[ccount]);
    SendClientMessageToAll(COLOR_GREEN, str); //Change the colour!
    format(str, sizeof(str), "%s: %s", BOT_NAME, Chats[ccount]);
    printf(str);
    return 1;
}
#endif
Reply


Messages In This Thread
Creating a bot system based on .txt file - by JaKe Elite - 23.04.2013, 03:48
Re: Creating a bot system based on .txt file - by Emmet_ - 23.04.2013, 10:09
Re: Creating a bot system based on .txt file - by JaKe Elite - 23.04.2013, 10:24
Re: Creating a bot system based on .txt file - by Sithis - 23.04.2013, 11:04

Forum Jump:


Users browsing this thread: 1 Guest(s)