Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Recommended Posts

Hi I wanna to do a BadWords script so i need a code that check if any word are in the message

 

Example code:

 

_badwords = ["Bitch", "Fuck", "Fuck You"];

_message = "You are a Bitch";  //(imagine that this message was recover in a dialog that was the chat).

// next code is the wrong

if (_message in _badwords) then {

hint "You said a bad word";

};

// 😧 that cant becouse to give true need that the badword contain all the message, is imposible so any can help me?

 

Pd: thats not the code, this is and example, sorry if the code is very wrong but im writing in my iPhone the script :,o

 

 

Share this post


Link to post
Share on other sites
8 minutes ago, FuRixX Lamborghini said:

Hi I wanna to do a BadWords script so i need a code that check if any word are in the message

This is going to be fun.

 

8 minutes ago, FuRixX Lamborghini said:

_badwords = ["Bitch", "Fuck", "Fuck You"];

Being Scottish I can beef this up for you if you want. Just say the word.

 

 

Now... I'll f**k off and see what s**te I can come up with.

  • Haha 1

Share this post


Link to post
Share on other sites

I'm not convinced this is the best method and I have no idea how you would check every message.

 

However, it might start the ball rolling:

Spoiler

//	So I don't get banned from the forums...
_badWords = ["badWord_1", "badWord_2", "badWord_3", "badWord_4", "badWord_5", "badWord_6"];

//	Switch order for testing.
_message = "Your mother is a lovely lady, friend!";
_message = "Your mother is a badWord_2 badWord_4, badWord_6!";

{
	_isSwearing = [_x, _message, false] call BIS_fnc_inString;

	if (_isSwearing) exitWith { hint "Get the soap..."; };
} count _badWords;

 

 

Your Life server sounds like a riot.

 

Share this post


Link to post
Share on other sites
1 hour ago, Maff said:

I'm not convinced this is the best method and I have no idea how you would check every message.

 

However, it might start the ball rolling:

  Hide contents


//	So I don't get banned from the forums...
_badWords = ["badWord_1", "badWord_2", "badWord_3", "badWord_4", "badWord_5", "badWord_6"];

//	Switch order for testing.
_message = "Your mother is a lovely lady, friend!";
_message = "Your mother is a badWord_2 badWord_4, badWord_6!";

{
	_isSwearing = [_x, _message, false] call BIS_fnc_inString;

	if (_isSwearing) exitWith { hint "Get the soap..."; };
} count _badWords;

 

 

Your Life server sounds like a riot.

 

 

Bro you're the best, thanks for help i will test that in my computer and if you need help contact with me

Share this post


Link to post
Share on other sites

×