AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question about comparing strings (https://forums.alliedmods.net/showthread.php?t=172254)

Doc-Holiday 11-17-2011 22:51

Question about comparing strings
 
So in my server we like to keep things pretty family oriented. Meaning no cursing or offensive names.

So say some one comes into the game with the name "Top Assassin". and i dont want the word ASS to be used in a name. if i compare the string with contain flag it will catch assassin right?

So thats one issue but if i use equal DUMBFUCKBITCH wouldn't be caught no matter what filter.

So is there away to make sure its not part of a larger word (to be honest it needs some one watching it.)

Hunter-Digital 11-17-2011 23:26

Re: Question about comparing strings
 
If you want a relatively accurate way you'll need a dictionary to skip words like "assassin" but not "dumbass" for example.

Still, people can screw words up and avoid any automated filtering methods anyway, so the best way is to have active admins that maintain the order if you really want to keep things cool, I've been using it while I had the server and it was much better than any other server that used plugins instead.

fysiks 11-18-2011 00:24

Re: Question about comparing strings
 
Quote:

Originally Posted by Doc-Holiday (Post 1598374)
So say some one comes into the game with the name "Top Assassin". and i dont want the word ASS to be used in a name. if i compare the string with contain flag it will catch assassin right?

What is "conatin flag"?

Quote:

Originally Posted by Doc-Holiday (Post 1598374)
So thats one issue but if i use equal DUMBFUCKBITCH wouldn't be caught no matter what filter.

What? No, it does not contain the word "ass".

Doc-Holiday 11-18-2011 18:16

Re: Question about comparing strings
 
Quote:

Originally Posted by fysiks (Post 1598391)
What is "conatin flag"?



What? No, it does not contain the word "ass".

Thanks hunter for understanding me...

Containi native is what I meant.

And it was an example.not meant to have ass in the swear word name...

I think I'm going to make it alert the admins that are.on the server if there is as well as a console.message since most of my servers are home servers. We watch the consoles alot.

Thanks though

fysiks 11-18-2011 22:55

Re: Question about comparing strings
 
Quote:

Originally Posted by Doc-Holiday (Post 1598781)
And it was an example.not meant to have ass in the swear word name...

It helps when examples make some sense.


All times are GMT -4. The time now is 08:27.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.