01.03.2016, 16:01
Hey guys
I would need you to help me with censorship but when I write I curse so will send the message but it gives such a word.fuck = **** and the rest normally Thank you
![Cheesy](images/smilies/biggrin.png)
![Smiley](images/smilies/smile.png)
#include <a_samp> main() { new badwords[][] = {"fuck", "bitch"}; new input[] = "fuck you bitch"; // whatever string you want to test print(input); for (new i, pos; i < sizeof badwords; i++) while ((pos = strfind(input, badwords[i], true), pos) != -1) for (new p; p < strlen(badwords[i]); p++) input[pos + p] = '*'; print(input); }
#include <a_samp> main() { new badwords[][] = {"fuck", "bitch"}; new input[] = "fuck you bitch"; // whatever string you want to test print(input); for (new i, pos; i < sizeof badwords; i++) while ((pos = strfind(input, badwords[i], true), pos) != -1) for (new p; p < strlen(badwords[i]) - 1; p++) input[pos + p + 1] = '*'; print(input); }
new badwords[][] = {"fuck", "bitch"};
public OnPlayerText(playerid, text[]){
for(new i, pos; i < sizeof badwords; i++){
while((pos = strfind(text, badwords[i], true), pos) != -1){
for(new p; p < strlen(badwords[i]) - 1; p++){
text[pos + p + 1] = '*';
}
}
}
//...
return 1;
}