another little question /changename cmd error special characters
#3

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!");
}
Reply


Messages In This Thread
another little question /changename cmd error special characters - by flrp - 15.10.2013, 21:44
Re: another little question /changename cmd error special characters - by Juniiro3 - 15.10.2013, 22:00
Re: another little question /changename cmd error special characters - by LeMoi - 15.10.2013, 23:48
Re: another little question /changename cmd error special characters - by flrp - 16.10.2013, 18:10

Forum Jump:


Users browsing this thread: 1 Guest(s)