10.09.2011, 17:39
(
Last edited by OPremium; 10/09/2011 at 05:42 PM.
Reason: ...
)
pawn Code:
new File:FName = fopen("Forbidden/ForbiddenNames.txt", io_read);
new ForbiddenNames[100];
while(fread(FName, ForbiddenNames)) //Reads the file line-by-line -> https://sampwiki.blast.hk/wiki/Fread
{
//printf(ForbiddenNames);
strdel(ForbiddenNames, strfind(ForbiddenNames, "\r\n", false), strfind(ForbiddenNames, "\r\n", false)+4)); //Deletes the "New line" (\r\n) from the string
if(strfind(GetName(playerid), ForbiddenNames, true) != -1) //Searchs the forbidden word
{
SendClientMessage(playerid, COLOR_ORANGE, " ** We found a forbidden word in your name! Please remove it and re-connect. ");
Kick(playerid); //Kick xD
}
}
fclose(FName);