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:
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:
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 (message, 191)
remove_quotes (message)
// super stuff comes here what I don't know
}
Edit:
Thanks wickedd, I haven't seen that before