15.10.2013, 23:48
try this
pawn Код:
#define N_CENSORED 2 //number of censored words
#define N_CENSORED_LEN 32 //length of max string
static const Censored[N_CENSORED_LEN][(N_CENSORED_LEN + 1) char] = {
!"а",
!"б",
!"й",
!"и",
!"у",
!"т",
!"ъ",
!"щ",
};
stock ContainsCensored(const input[]) {
for(new i = 0; i != N_CENSORED; ++i) {
if(strfind(input, Censored[i], true) != -1) return 1;
}
return 0;
}
//...
if(ContainsCensored(inputtext)) {
SendClientMessage(playerid, COLOR_TOMATO, "Error: The text cannot contain swearwords/some characters!");
}