22.11.2011, 19:33
(
Последний раз редактировалось TheChaoz; 02.12.2011 в 14:46.
)
Quote:
ALGUIEN ME PUEDE DESIR SI POR LO MENOS ESISTE UN FS DE Q CUANDO ESCRIBIS MALAS PALABRAS EN EL CHAT APARESCA ESTO ***** POR EJEMPLO:
HIJO DE **** POR LO MENOS DIGNAME SI ESISTE Y SI ESISTE COMO S LLAMA Q YO LO BUSCO POR MI CUENTA |
pawn Код:
#include <a_samp>
#define MAX_BAD_WORDS (100)
new Words[MAX_BAD_WORDS][64], WordsCount;
public OnFilterScriptInit() //OnGameModeInit() para un GameMode
{
new File:Fhnd, line[64];
Fhnd = fopen("BadWords.txt", io_readwrite);
while(fread(Fhnd, line)){
for(new i, j=strlen(line); i<j; i++)
if(line[i] == '\n' || line[i] == '\r')line[i] = '\0';
strins(Words[WordsCount], line, 0);
WordsCount++;
}
fclose(Fhnd);
return 1;
}
public OnPlayerText(playerid, text[]){
new pos;
for(new i; i<WordsCount; i++)
if((pos = strfind(text, Words[i], true)) != -1)
for(new n=pos, j=(pos+strlen(Words[i])); n<j; n++)
text[n] = '*';
return 1;
}