Raised This Month: $28 Target: $400
 7% 

[Request]Check for same chatmessages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RaZ_HU
Senior Member
Join Date: May 2015
Location: Hungary
Old 09-01-2015 , 08:13   [Request]Check for same chatmessages
Reply With Quote #1

Hi,

I would like to request code stuff to prevent the same message spamming in the chat.
For example if someone binds "say x;say x;say x; say x" to a button and he/she presses it it fills the chat area with 4lines.

That would look like:
Code:
player: x
player: x
player: x
player: x
I have two idea to prevent that, but of course I can't do them.

1. Idea:
Check if the last message sent 2 sec ago and same as the new message, if yes grab the new one and do not display it.
Output would look like:
Code:
player: x
2. Idea:
Count up the lines if someone says the same thing under 2 sec ago and if yes count them up and say it once only with a counter.
Output would look like:
Code:
player: x    -x4

Are these even possible?

The only code I have yet...:

PHP Code:
public plugin_init()
{
    
register_clcmd("say""hook_say")
    
register_clcmd("say_team""hook_say")
}
public 
hook_say(id)
{
    new 
message[192]
    
read_args (message191)
    
remove_quotes (message)

    
// super stuff comes here what I don't know



Edit:
Thanks wickedd, I haven't seen that before

Last edited by RaZ_HU; 09-01-2015 at 08:26. Reason: Update
RaZ_HU is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 09-01-2015 , 08:23   Re: [Request]Check for same chatmessages
Reply With Quote #2

Take a look at "No Chat Spam" by Exolent it should help you.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Reply


Thread Tools
Display Modes

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 02:09.


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