SA-MP Forums Archive
Really confused now. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Really confused now. (/showthread.php?tid=280532)



Really confused now. - SloProKiller - 01.09.2011

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.


Re: Really confused now. - [MWR]Blood - 01.09.2011

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.


Re: Really confused now. - SloProKiller - 01.09.2011

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.


Re: Really confused now. - [MWR]Blood - 01.09.2011

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!