Raised This Month: $51 Target: $400
 12% 

Words/Sentences Counter + Words Blocking(filter) [Version 1.2]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Statistical        Approver:   Hawk552 (427)
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-28-2009 , 18:28   Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #1

Words/Sentences Counter(+ Words Filter)
Version 1.2
by Dores

Note: Tested on CS 1.6 only, but should work for all mods(leaving Modification on Counter-Strike until I'm sure it's for all mods).

Requested here(idea by aNt1).


Description:


This plugin counts how many times every word/sentence that is on a specific list has been said in chat by players.
This plugin also gives admins the option to block certain words and prevent them from appearing in chat. Like Swear-Filters, but simpler.
It will replace the blocked word(s) with another text(defined by a CVar).


Why would you want it in your server?
Quote:
Originally Posted by aNt1 View Post
I use sank sounds and I want to see which sounds (words) are not used to clear them and reduce the download time for clients. Also I want to use it to see which swears are used often or if a certain way to avoid gag from this plugin is used often so I'll add it to blacklist.



How to use:

Go to addons/amxmodx/configs and create there a folder and call it: "words_counter". In it, create two files:

  • words_counter.ini
  • blocked_words.ini
In words_counter.ini, put the words(or sentences) that you want the plugin to count.

Example of words_counter.ini:
Code:
lol
/rank
/top15
"This is a sentence"
"This is a sank sound"
"This is a swear"
Sw34r
After a few days with the plugin on, the file should look like so:
Code:
lol 74
/rank 116
/top15 200
"This is a sentence" 57
"This is a sank sound" 23
"This is a swear" 0
Sw34r 1500
blocked_words.ini should look the same as words_counter.ini:
Code:
blocked
sw34r
lol
can't
nope
Console Commands:

Note: All commands can be used by an admin with a ADMIN_CHAT flag.
  • amx_words_block <word> <[un]block> <temp> - Blocks/Unblocks a word from appearing in chat(a replacement will be shown set by a CVar). If temp is 1, it will not save the word to the blocked words file and will not be blocked after server restart/map change or when unblocked. To block a complete sentence, wrap the sentence with quotes("). Example: amx_words_block "hello, sir" 1 1.
  • amx_words_clear - Clears the blocked words list(and temporarily blocked words).
  • amx_words_count <word> <case sensitive> - Shows how many times 'word' have been said according to words_counter.ini. If case sensitive is 1, 'word' must be same as the word in words_counter.ini upper and lower cases wise. This is good to know which words should be blocked without constantly minimizing the game and checking the file.
CVars:
  • words_counter_chat [Default: 1] - If set to 0, the plugin won't count words/sentences.
  • words_counter_case [Default: 0] - If set to 1, the words that are being said must be exactly like the words in the file.
  • sentences_counter_case [Default: 0] - If set to 1, the sentences that are being said must be exactly like the sentences in the file.
  • words_blocked_case [Default: 0] - Same as [words|sentences]_counter_case, but for blocked words.
  • words_blocked_replace [Default: [*WORD REMOVED*]] - Set the replacement text instead of blocked words. To put nothing, use it in the following format: words_blocked_replace "" (use empty "quotes").
Installation:
  1. Click the Get Plugin button(or Get Source to get the .sma), and save the .amxx file at addons/amxmodx/plugins(if you pressed Get Source, drag the .sma file to amxxpc.exe which is located at addons/amxmodx/scripting).
  2. Go to amxmodx/configs and open plugins.ini.
  3. Type in it: words_counter.amxx debug (Note: you should put the file at the top of the list to decrease possible lags).
  4. Your plugins.ini should finally look like this:
Code:
words_counter.amxx debug
other_plugin.amxx
another_plugin.amxx debug
another_one.amxx
...
last_plugin.amxx debug
Credits:

aNt1 - Idea.
DanielKZA - Showed how to find a word inside a string.


To do:
  • Add more options for replacement text for blocked words.
Attached Files
File Type: sma Get Plugin or Get Source (words_counter.sma - 2724 views - 13.7 KB)
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 11-07-2010 at 13:06.
Dores is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 01-28-2009 , 21:13   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #2

oh nice one Dores.. =)
Mlk27 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-28-2009 , 21:34   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #3

Quote:
Originally Posted by Dores View Post
Note: To block a whole sentence, put the words that build the sentence.
i.e: I don't want a player to say "go to hell":
Code:
// At blocked_words.ini:
go
to
hell
Now, when a player wants to type "go to hell", it will look something like:
Player: [*WORD REMOVED*] [*WORD REMOVED*] [*WORD REMOVED*]
'[*WORD REMOVED*]' is the default of the replacement text CVar.
Will it always remove those words if they aren't in the same sequence, or does it check for them to be a sentence?

Example:
If I typed: "Go to spawn!"
Will it output: "[*WORD REMOVED*] [*WORD REMOVED*] spawn!" ?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-28-2009 , 23:46   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
If I typed: "Go to spawn!"
Will it output: "[*WORD REMOVED*] [*WORD REMOVED*] spawn!" ?
Yes. I will add the ability to block complete sentences soon.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 01-29-2009 at 04:43.
Dores is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 01-29-2009 , 04:47   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #5

LOL, this is really interesting!
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Old 01-29-2009, 04:50
Dores
This message has been deleted by Dores.
FakeNick
Senior Member
Join Date: Feb 2008
Location: Poland
Old 01-29-2009 , 08:52   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #6

Nice one ;).
__________________


[||||||||||] Snowball war v3.05

Pol
ish translations here ;) (PM me if you want one).


FakeNick is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-29-2009 , 09:09   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #7

Quote:
Originally Posted by FakeNick View Post
Nice one ;).
Quote:
Originally Posted by Mlk27 View Post
oh nice one Dores.. =)
Just have to say this: "Nice one", cause it's so lame
SnoW is offline
Send a message via MSN to SnoW
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-29-2009 , 10:48   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #8

Quote:
Originally Posted by SnoW View Post
Just have to say this: "Nice one", cause it's so lame
If you think that the plugin is lame, post why. If you don't want to post why it's lame, don't post here.
Unless you meant that "Nice one" is lame?
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 01-29-2009 at 10:51.
Dores is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 01-29-2009 , 10:52   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #9

Really like the idea!

good job.
BOYSplayCS is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 01-29-2009 , 11:01   Re: Words/Sentences Counter + Words Blocking(filter) [Version 1.2]
Reply With Quote #10

When the words_block_replaced is set to "" does that mean there will be a space where the word is being blocked? If i'm correct, it should leave a space due to not showing the word at all.
BOYSplayCS is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:12.


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