21.01.2017, 06:49
i have this function
and this under OnPlayerText
but the text does'nt return in the formatted text given above..
Код:
antiswear(text[]) { if((strlen(text) < 3)) { 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 } } } } return text; }
Код:
for(new s = 0; s < strlen(text); s++) text[s] = tolower(text[s]); antiswear(text); if(gTeam[playerid] != 100 && gTeam[playerid] != 101 && VIP[playerid] == 0) format(strtext, sizeof(strtext), "%s [%d]: %s", PlayerName(playerid), playerid, text); if(gTeam[playerid] != 100 && gTeam[playerid] != 101 && VIP[playerid] != 0 && GetPVarInt(playerid,"undercover") == 1) format(strtext, sizeof(strtext), "%s [%d]: %s", PlayerName(playerid), playerid, text); else if(gTeam[playerid] != 100 && gTeam[playerid] != 101 && VIP[playerid] != 0 && GetPVarInt(playerid,"undercover") == 0) format(strtext, sizeof(strtext), "VIP %s [%d]: %s", PlayerName(playerid), playerid, text); else if(gTeam[playerid] == 100 || gTeam[playerid] == 101) format(strtext, sizeof(strtext), ">> CLANWAR << %s [%d]: %s", PlayerName(playerid), playerid, text);