public OnPlayerText(playerid, text[])
{
new string[64];
new File:forbiddenwords = fopen("ForbiddenWords.txt", io_read);
while(fread(forbiddenwords, string))
{
SendClientMessage(playerid, 0xFFFFFFF, "That word is forbidden!!!");
}
fclose(forbiddenwords);
return 1;
}
public OnPlayerText(playerid, text[])
{
new string[64];
new File:forbiddenwords = fopen("ForbiddenWords.txt", io_read);
while(fread(forbiddenwords, string))
{
if(strfind(string, text, true) != -1)
{
return SendClientMessage(playerid, 0xFFFFFFF, "That word is forbidden!!!");
}
}
fclose(forbiddenwords);
return 1;
}
public OnPlayerText(playerid, text[])
{
new string[64];
new File:forbiddenwords = fopen("ForbiddenWords.txt", io_read);
while(fread(forbiddenwords, string))
{
if(!strcmp(string,text))
{
SendClientMessage(playerid, 0xFFFFFFF, "That word is forbidden!!!");
fclose(forbiddenwords);
return 0;
}
}
fclose(forbiddenwords);
return 1;
}
Ummmmmm... Try this.
pawn Код:
|
public OnPlayerText(playerid, text[])
{
new
string[64],
File:forbiddenwords = fopen("ForbiddenWords.txt", io_read);
while(fread(forbiddenwords, string))
{
if(!strcmp(string,text))
{
SendClientMessage(playerid, 0xFFFFFFF, "That word is forbidden!!!");
fclose(forbiddenwords);
return 0;
}
}
fclose(forbiddenwords);
return 1;
}
I don't. It returns 0 right after it closes it. Ending the loop. And if you want to complain about indentations...
pawn Код:
|
public OnPlayerConnect(playerid)
{
new string[64], File:forbiddennames = fopen("ForbiddenNames.txt", io_read);
while(fread(forbiddennames, string))
{
if(!strcmp(string))
{
SendClientMessage(playerid, 0xFFFFFFF, "Forbidden Name!!!");
Kick(playerid);
fclose(forbiddennames);
return 0;
}
}
fclose(forbiddennames);
return 1;
}
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\OpenFile.pwn(26) : warning 202: number of arguments does not match definition
if(!strcmp(string))
if(!strcmp(string,text))
error 017: undefined symbol "text"