01.09.2011, 17:33
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:
Yes, the file does exist.
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;
}