yINI help. -
Код:
enum BanConfiguration
{
ExistBan,
BannedIP[16],
ip1st,
Banid,
BannedBy[MAX_PLAYER_NAME],
BannedFor[56],//reason
TimeOfBan[7], //day, month, year; hour, minute, second;
TimeOfUnban[7], //Time when gets unbanned, if it's timebanned. 0 for perm banned.
}
new Banned[100000 char][BanConfiguration];
forward LoadBan_banid(banid,name[],value[]);
public LoadBan_banid(banid,name[],value[])
{
INI_Int("ExistBan",Banned[banid][ExistBan]);
INI_String("BannedIP",Banned[banid][BannedIP],16);
INI_Int("ip1st",Banned[banid][ip1st]);
INI_Int("Banid",Banned[banid][Banid]);
INI_String("BannedBy",Banned[banid][BannedBy],MAX_PLAYER_NAME);
INI_String("BannedFor",Banned[banid][BannedFor],56);
INI_String("Time Of ban",Banned[banid][TimeOfBan],7);
INI_String("Time of Unban",Banned[banid][TimeOfUnban],7);
return 1;
}
LoadBans()
{
new dest[20];
new count = GetTickCount();
for (new i = 0;i<lastbanned;i++)
{
format(dest,sizeof(dest),"Users/Bans/%d.ini",i);
new INI:Bans = INI_Open(dest);
if (fexist(dest))
{
new string[6];
format(string,sizeof(string),"%d.ini",i);
new other[] = string;
INI_Load(other);
}
}
printf("Time taken to execute bans: %d", GetTickCount() - count);
}
It's just have to load all bans and put in right variables. However, i get some errors:
C:\Users\Radojkovic\Desktop\Server 0.3e RC6\gamemodes\Aco.pwn(959) : error 008: must be a constant expression; assumed zero
C:\Users\Radojkovic\Desktop\Server 0.3e RC6\gamemodes\Aco.pwn(959) : error 036: empty statement
C:\Users\Radojkovic\Desktop\Server 0.3e RC6\gamemodes\Aco.pwn(960) : error 017: undefined symbol "other"
It should load all bans, maximum 100 000, and idk how to do it.. please halp asap
Re: yINI help. -
Re: yINI help. -
Re: yINI help. -