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


Messages In This Thread
Really confused now. - by SloProKiller - 01.09.2011, 17:33
Re: Really confused now. - by [MWR]Blood - 01.09.2011, 17:35
Re: Really confused now. - by SloProKiller - 01.09.2011, 17:37
Re: Really confused now. - by [MWR]Blood - 01.09.2011, 17:39

Forum Jump:


Users browsing this thread: 1 Guest(s)