AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Ultimate Chat + Addons (https://forums.alliedmods.net/showthread.php?t=236576)

Black Rose 05-18-2014 13:24

Re: Ultimate Chat + Addons
 
The file is in regular expression. normal words can be used of course as they are also expressions. Just very static ones.
Regex enables you to make it more dynamic. I suggest watching these tutorials on YouTube from Derek Banas:
https://www.youtube.com/playlist?lis...4F2FDD28D0C40E

\d+\D+\d+\D+\d+\D+\d+(?:\D+\d+)?
This will catch any number of digits followed by any number of non digits, repeated 3 times without the non-digits at the end and optional port after that.
It is very vague but there's no good way around it. The problem is that it will also catch for example:
"Hello, I got 25 kills, 10 deaths. That will make a k:d ratio of 2.5. Amaze"
But who writes 4 numbers in once sentence? I don't think that's very common.

AMeEeRo 05-18-2014 14:10

Re: Ultimate Chat + Addons
 
Quote:

Originally Posted by Black Rose (Post 2139514)
The file is in regular expression. normal words can be used of course as they are also expressions. Just very static ones.
Regex enables you to make it more dynamic. I suggest watching these tutorials on YouTube from Derek Banas:
https://www.youtube.com/playlist?lis...4F2FDD28D0C40E

\d+\D+\d+\D+\d+\D+\d+(?:\D+\d+)?
This will catch any number of digits followed by any number of non digits, repeated 3 times without the non-digits at the end and optional port after that.
It is very vague but there's no good way around it. The problem is that it will also catch for example:
"Hello, I got 25 kills, 10 deaths. That will make a k:d ratio of 2.5. Amaze"
But who writes 4 numbers in once sentence? I don't think that's very common.

Thanks but i know nothing about it, and you are right 4 numbers.....
So i add this line just like that ?
PHP Code:

\d+\D+\d+\D+\d+\D+\d+(?:\D+\d+) 

This will block ip ?
How about bad words i have some problems cuz of fk can you learn me simple way ?
i'm suing line like
PHP Code:

fk you
fk u 

To block fk..
Without videos just small examples please and thanks :)
And i want to ask you how to block, say /rs
I just want to block some commands from being on chat like say /rs say /rank but i don't one to hide words cuz i'm using ad_manger, they use say /ip to spam ip ( on other chat plugins ), I mean i just want to block registered commands like rs rank.. i tried to put the plugins under restscore.amxx and up, same :\
Please help great job again :)

Black Rose 05-18-2014 18:52

Re: Ultimate Chat + Addons
 
Quote:

Originally Posted by AMeEeRo (Post 2139544)
Thanks but i know nothing about it, and you are right 4 numbers.....
So i add this line just like that ?
PHP Code:

\d+\D+\d+\D+\d+\D+\d+(?:\D+\d+) 

This will block ip ?

Yes. It will block 4-5 numbers with anything but numbers in between. IP addresses included.
Quote:

Originally Posted by AMeEeRo (Post 2139544)
How about bad words i have some problems cuz of fk can you learn me simple way ?
i'm suing line like
PHP Code:

fk you
fk u 

To block fk..
Without videos just small examples please and thanks :)
And i want to ask you how to block, say /rs
I just want to block some commands from being on chat like say /rs say /rank but i don't one to hide words cuz i'm using ad_manger, they use say /ip to spam ip ( on other chat plugins ), I mean i just want to block registered commands like rs rank.. i tried to put the plugins under restscore.amxx and up, same :\
Please help great job again :)

"fk u" and "fk you" should work. Not sure what you want really...
Did not understand the part about /rs, /rank and /ip.

AMeEeRo 05-19-2014 04:42

Re: Ultimate Chat + Addons
 
Quote:

Originally Posted by Black Rose (Post 2139653)
Yes. It will block 4-5 numbers with anything but numbers in between. IP addresses included.


"fk u" and "fk you" should work. Not sure what you want really...
Did not understand the part about /rs, /rank and /ip.

Okey thanks, about /rs /rank
Some chat plugins block them, i mean when you right /anything no one see it, but in your plugin we can see, i don't want to see them i just want to block /rs and /rank i mean registered commands not anything after /

AMeEeRo 05-22-2014 04:39

Re: Ultimate Chat + Addons
 
2 More, when admins say /top15 the server prints op15 with team color, can you remove /t /g /y /n ?
Also, can you check admins chat ? Or add admins chat with your plugin, it should be really ultimate, admins chat is cool, but after we mute a player, he use admin chat to insult, so please make when player muted can't use admins chat and also make admins chat filtered by swear filter..
Thanks.

Black Rose 05-23-2014 18:42

Re: Ultimate Chat + Addons
 
Quote:

Originally Posted by AMeEeRo (Post 2139793)
Okey thanks, about /rs /rank
Some chat plugins block them, i mean when you right /anything no one see it, but in your plugin we can see, i don't want to see them i just want to block /rs and /rank i mean registered commands not anything after /

This has been fixed in version 1.4 of the UC base plugin using this code:

Code:
public plugin_init() {         //...         set_task(1.0, "PlaceUCLastInQue"); } public PlaceUCLastInQue() {     register_clcmd("say", "HandleSay");     register_clcmd("say_team", "HandleSay"); }
This will make sure that UC is the last plugin to receive the command, so if any other plugin blocks the message, it will never get picked up by UC.

It's all about where you place this plugin in the plugins.ini because that determines in which order everything is called, but the code above eliminates that problem.

...unless I'm not understanding you correctly.

Quote:

Originally Posted by AMeEeRo (Post 2140969)
2 More, when admins say /top15 the server prints op15 with team color, can you remove /t /g /y /n ?

I will definitely fix that tomorrow.

Quote:

Originally Posted by AMeEeRo (Post 2140969)
Also, can you check admins chat ? Or add admins chat with your plugin, it should be really ultimate, admins chat is cool, but after we mute a player, he use admin chat to insult, so please make when player muted can't use admins chat and also make admins chat filtered by swear filter..
Thanks.

I will take a look at it. No promises.

AMeEeRo 05-24-2014 10:56

Re: Ultimate Chat + Addons
 
Quote:

Originally Posted by Black Rose (Post 2141681)
This has been fixed in version 1.4 of the UC base plugin using this code:

Code:
public plugin_init() {         //...         set_task(1.0, "PlaceUCLastInQue"); } public PlaceUCLastInQue() {     register_clcmd("say", "HandleSay");     register_clcmd("say_team", "HandleSay"); }
This will make sure that UC is the last plugin to receive the command, so if any other plugin blocks the message, it will never get picked up by UC.

It's all about where you place this plugin in the plugins.ini because that determines in which order everything is called, but the code above eliminates that problem.

...unless I'm not understanding you correctly.



I will definitely fix that tomorrow.



I will take a look at it. No promises.

Thanks a lot but didn't understand, if i want to block /rs /rank where to put the plugin on plugins.ini ? above or under them ?
BTW, i tried two but same..

Black Rose 05-24-2014 11:47

Re: Ultimate Chat + Addons
 
I thought that some other plugin was supposed to block them.
If not, you can use this:

Code:
#include <amxmodx> #include <cstrike> new gCommands[][] = {     "/rs",     "/rank" } public plugin_init() {         register_plugin("Block", "1.0", "[ --{[email protected] ]");         set_task(0.8, "PlaceAlmostLastInQue"); } public PlaceAlmostLastInQue() {     register_clcmd("say", "HandleSay");     register_clcmd("say_team", "HandleSay"); } public HandleSay(id) {         if ( ! is_user_connected(id) )         return PLUGIN_CONTINUE;         static Text[192];     read_args(Text, charsmax(Text));     remove_quotes(Text);     trim(Text);         if ( ! Text[0] )         return PLUGIN_HANDLED;         for ( new i ; i < sizeof gCommands ; i++ ) {         if ( equali(Text, gCommands[i], strlen(gCommands[i])) )             return PLUGIN_HANDLED;     }         return PLUGIN_CONTINUE; }

AMeEeRo 05-24-2014 12:18

Re: Ultimate Chat + Addons
 
Quote:

Originally Posted by Black Rose (Post 2141909)
I thought that some other plugin was supposed to block them.
If not, you can use this:

Code:
#include <amxmodx> #include <cstrike> new gCommands[][] = {     "/rs",     "/rank" } public plugin_init() {         register_plugin("Block", "1.0", "[ --{[email protected] ]");         set_task(0.8, "PlaceAlmostLastInQue"); } public PlaceAlmostLastInQue() {     register_clcmd("say", "HandleSay");     register_clcmd("say_team", "HandleSay"); } public HandleSay(id) {         if ( ! is_user_connected(id) )         return PLUGIN_CONTINUE;         static Text[192];     read_args(Text, charsmax(Text));     remove_quotes(Text);     trim(Text);         if ( ! Text[0] )         return PLUGIN_HANDLED;         for ( new i ; i < sizeof gCommands ; i++ ) {         if ( equali(Text, gCommands[i], strlen(gCommands[i])) )             return PLUGIN_HANDLED;     }         return PLUGIN_CONTINUE; }

This new plugins to block some commands ?
That's what what i want :)
You can make add it on first post ultimate_chat_block.sma it will be cool for most..
Thanks a lot.
EDIT: where to place this plugin, above or under ultimate chat ?

Black Rose 05-25-2014 06:11

Re: Ultimate Chat + Addons
 
Quote:

Originally Posted by AMeEeRo (Post 2141923)
This new plugins to block some commands ?
That's what what i want :)
You can make add it on first post ultimate_chat_block.sma it will be cool for most..
Thanks a lot.
EDIT: where to place this plugin, above or under ultimate chat ?

The plugin will place itself after everything but before UC. You can put it anywhere.
If I were to release that I should at least make it read from a file.


All times are GMT -4. The time now is 04:43.

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