07.09.2011, 11:56
I don't think it's a good idea to use ini files for something like this. The name of the key is not important and therefor using ini is pointless. Using plain text file:
I just typed this out of my head, but I think it would work.
Код:
fuck shit bitch
pawn Код:
new
File:handle = fopen("FAdmin/Logs/Forbidenwords.txt", io_read),
word[32],
i;
if(handle)
{
while(fread(handle, word))
{
if(i >= sizeof(ForbiddenWords)) // Out of bounds protection
{
printf("Warning: Could not load more than %d words. Destination array is too small!");
break;
}
strcpy(ForbidenWords[i], word);
i++;
}
fclose(handle);
printf("Words loaded: %d", i);
}
else printf("Forbidden words file not found, or it could not be opened!");
pawn Код:
stock strcpy(dest[], const source[], maxlength=sizeof dest)
{
strcat((dest[0] = EOS, dest), source, maxlength);
}