21.01.2017, 08:59
doesnt work
my edited code
still doesnt work
my edited function
my edited code
Код:
public OnPlayerText(playerid, text[]) { if(text[0] == '@') { text[1] = antiswear(text[1]); // bfchat with anti swear new string[128]; format(string, sizeof(string), "BF_CHAT %s [%d]: %s", PlayerName(playerid),playerid,text[1]); SendClientMessage(playerid,0xFF8C00FF,string); //printf(string); } else { for(new s = 0; s < strlen(text); s++) text[s] = tolower(text[s]); for(new j = 0; j < strlen(text); j++) text[j] = antiswear(text[j]); } return 0; }
my edited function
Код:
antiswear(text[]) { new chatswear,len; for(new cs = 0; cs < MAX_WORDS; cs++) { //check if the word is offensive chatswear = strfind(text, swear[cs], true); if(chatswear > -1) { len = strlen(swear[cs]); if(len < 3) break; for(new y = 1; y < len; y++) { text[y] = '*'; //chatswear+y } } } }