28.11.2013, 11:26
is there is something wrong with this code ?
all my script have the same method but my server crash because he cant write on non exsit file
is there is any way to check what is the non exist file ?
all my script have the same method but my server crash because he cant write on non exsit file
is there is any way to check what is the non exist file ?
pawn Код:
stock CheckBan(ip[])
{
new string[20];
if(fexist("ban.cfg"))
{
new File: file = fopen("ban.cfg", io_read);
while(fread(file, string))
{
if (strcmp(ip, string, true, strlen(ip)) == 0)
{
fclose(file);
return 1;
}
}
fclose(file);
}
return 0;
}