Really confused now.
#1

I'm trying to make y_ini read from a file called Admins.INI, then save the values OwnerHost and OwnerNick into ownnick and ownhost (both globals).
Code:
pawn Код:
IC(join) //defined, don't worry
{
    if(IsAdmin(user, host))
    {
        if(isnull(params)) return Say(gBotID, user, "USAGE: !join <channel>");
        else
        {
            Join(gBotID, params);
        }
    }
    return 1;
}



stock IsAdmin(user[], host[])
{
    INI_Load("Admins.INI");
    if(!strcmp(ownnick, user) && !strcmp(ownhost, host)) return 1;
    else return 0;
}

INI:Admins[](name[], value[])
{
    INI_String("OwnerNick", ownnick, sizeof(ownnick));
    INI_String("OwnerHost", ownhost, sizeof(ownhost));
    return 0;
}
Yes, the file does exist.
Reply
#2

Even if ****** is a good scripter, Y_Ini is not magic.
You can't expect the file to show up without coding it.
INI_Open(file) Creates the file specified if it doesn't exist.
Reply
#3

Quote:
Originally Posted by [MWR]Blood
Посмотреть сообщение
Even if ****** is a good scripter, Y_Ini is not magic.
You can't expect the file to show up without coding it.
INI_Open(file) Creates the file specified if it doesn't exist.
The file already exists.
Reply
#4

Quote:
Originally Posted by SloProKiller
Посмотреть сообщение
The file already exists.
Oh well sorry, I seemed to read that it doesn't exist, as with this code, I really don't see how would it appear!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)