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

Block say ip in server - Block ip - Block ip in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose       
SEMO.Pa3x
Junior Member
Join Date: Oct 2016
Location: Iraq/Najaf
Old 10-10-2016 , 06:57   Block say ip in server - Block ip - Block ip in chat
Reply With Quote #1

Block IP's


PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <fun>
#include <fakemeta>
#include <fakemeta_util>
#include <regex>
#include <colorchat>

#define PLUGIN "Block IP's [JGHG] + [SEMO.Pa3x]"
#define VERSION "2.0"
#define AUTHOR "[JGHG] + [SEMO.Pa3x]"

new bool:Gagged[33];

#define PATTERN                "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
#define CVAR_BANVIOLATORS    "ip_banviolators"
new Regex:g_result
new g_returnvalue
new g_error[64]
new 
g_allArgs[1024]

public 
plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
register_clcmd("say""hook_say")
register_clcmd("say""Client_Command_Say"); 
register_clcmd("say_team""Client_Command_Say_Team");
register_concmd("amx_ungag","cmdUnGag"ADMIN_CHAT"[name]");
}

public 
plugin_modules()
{
require_module("regex")
}

public 
hook_say(idlevelcid)
{
static 
name[32]    
get_cvar_string("hostname"namecharsmax(name))
read_args(g_allArgs1023)
g_result regex_match(g_allArgsPATTERNg_returnvalueg_error63)
switch (
g_result) {
case 
REGEX_MATCH_FAIL: {
return 
PLUGIN_CONTINUE
}
case 
REGEX_PATTERN_FAIL: {
return 
PLUGIN_CONTINUE
}
case 
REGEX_NO_MATCH: {
return 
PLUGIN_CONTINUE
}
default:
{
if (
get_cvar_num(CVAR_BANVIOLATORS))
{    
}
else
{
new 
szname[32]
get_user_name(idszname31)    
if(
Gagged[id])
{
return 
PLUGIN_HANDLED;
}
Gagged[id] = true;    
ColorChat(0GREY"^1[SERVER]^4 %s^1: gag^4 %s^1 for^3 all this rounds"nameszname)
ColorChat(0GREY"^4reason:^1 share ip server")
}
regex_free(g_result)
return 
PLUGIN_HANDLED // block msg
}
}
return 
PLUGIN_CONTINUE
}

get_target(idArg[])
{
new 
player find_player("bl"Arg)
if(
player)
{        
if(
player != find_player("blj"Arg)) {    
console_print(id"[CS] User not found..")        
return 
false
}
}
else if((
player find_player("c"Arg)) == && Arg[0] == '#' && Arg[1])
player find_player("k"str_to_num(Arg[1]))
if(!
player)
console_print(id"[CS] User not found..")
return 
player    
}

public 
cmdUnGag(id,level,cid)
{
if (!
cmd_access(idlevelcid2))
{
ColorChat(idGREY"^4[CS]^1 You have no access.")
return 
PLUGIN_HANDLED
}

new 
arg[32],admin[32],player[32];
read_argv(1,arg,31);
new 
target=get_target(idarg)
if(!
target)return PLUGIN_HANDLED;
get_user_name(id,admin,31);
get_user_name(target,player,31);
if(!
Gagged[target]){
return 
PLUGIN_HANDLED;
}
Gagged[target]=false;
ColorChat(0GREY"^1[ADMIN]^4 %s^1: ungag^4 %s",admin,player);    
remove_task(target);
return 
PLUGIN_HANDLED;
}

public 
Client_Command_Say(id)
{
if(!
is_user_connected(id)) 
{
return 
PLUGIN_HANDLED_MAIN
}

// Gagged
if(Gagged[id])
{
ColorChat(idGREY"^4[CS]^1 You have been^4 muted^1 from use chat...")
return 
PLUGIN_HANDLED;
}
return 
PLUGIN_CONTINUE;
}

public 
Client_Command_Say_Team(id)
{
if(!
is_user_connected(id)) 

return 
PLUGIN_HANDLED_MAIN
}
// Gagged
if(Gagged[id])
{
ColorChat(idGREY"^4[CS]^1 You have been^4 muted^1 from use chat...")
return 
PLUGIN_HANDLED;
}
return 
PLUGIN_CONTINUE;

| Description:
this plugin block users in your server from share any ip's
example: 11.22.33.44:5555 it will give the user gagg from use chat .

| Features:
if any one have gagged you can ungag him if you are have flag ADMIN_CHAT
type in console: amx_ungag [name]

| Author:
made by: JGHG
moded by: SEMO.Pa3x

| Note:
i'm not a professional programmer
i'm just learn by experience.
Attached Files
File Type: sma Get Plugin or Get Source (BlockIP's.sma - 700 views - 3.2 KB)

Last edited by SEMO.Pa3x; 10-10-2016 at 06:58.
SEMO.Pa3x is offline
Send a message via Skype™ to SEMO.Pa3x
BeNq!
Senior Member
Join Date: Mar 2009
Old 10-10-2016 , 08:58   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #2

LOL.

Code:
#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <fun>
#include <fakemeta>
#include <fakemeta_util>
#include <regex>
#include <colorchat>
->

Code:
#include <amxmodx>
#include <amxmisc>
#include <regex>
#include <colorchat>

Last edited by BeNq!; 10-10-2016 at 08:59.
BeNq! is offline
ish12321
Veteran Member
Join Date: May 2016
Old 10-10-2016 , 17:45   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #3

will this block :
Website : Port
Website
iP in this way : 192 | . | 168 | . | 1 | . | 1 | : | 27015
And like this 192,168,1,1

Website Like : www | . | google | . | com
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here

Last edited by ish12321; 10-10-2016 at 17:47.
ish12321 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 10-10-2016 , 17:49   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #4

Look like you c/p this plugin together.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
ish12321
Veteran Member
Join Date: May 2016
Old 10-11-2016 , 03:42   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #5

Quote:
Originally Posted by wickedd View Post
Look like you c/p this plugin together.
Whats c/p
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 10-11-2016 , 05:19   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #6

copy/paste.

It's not his plugin, he just put his name on it.
safetymoose is offline
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 10-11-2016 , 05:28   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #7

And absolutely no indentation.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
KleinMarquez
Senior Member
Join Date: Jun 2016
Location: Calapan City, Philippine
Old 10-11-2016 , 07:38   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #8

This plugin is awesome, somebody will say whats ip address.
KleinMarquez is offline
SEMO.Pa3x
Junior Member
Join Date: Oct 2016
Location: Iraq/Najaf
Old 10-12-2016 , 00:58   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #9

Quote:
Originally Posted by safetymoose View Post
copy/paste.

It's not his plugin, he just put his name on it.

copy/past ??
ok watch this original plugin

PHP Code:
#define PLUGINNAME    "Don't say IPs" 
#define VERSION        "0.1" 
#define AUTHOR        "JGHG" 
/* 
Copyleft 2005 
Plugin topic: http://www.amxmodx.org/forums/viewtopic.php?p=90172 


Don't say IPs 
============= 
Messages like "hey join my server 213.34.231.23" are automatically blocked... and another message is printed instead. :-P 
Or, you can choose to just ban violators by setting cvar ip_banviolators to 1 and ip_banminutes to how many minutes the violator should be banned. 0 is permanent, 5 is default. 

/JGHG 


VERSIONS 
======== 
050204    0.1    First version 


CREDITS 
======= 
Requested by lord_inuyasha88. 
*/ 

#include <amxmodx> 
#include <regex> 

#define PATTERN                "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" // \b 
#define REASON                "IP advertising" 
#define CVAR_BANMINUTES        "ip_banminutes" 
#define CVAR_BANVIOLATORS    "ip_banviolators" 

// Globals below 
new Regex:g_result 
new g_returnvalue 
new g_error[64
new 
g_allArgs[1024
// Globals above 

public plugin_modules() { 
    
require_module("regex"


public 
hook_say(idlevelcid) { 
    
read_args(g_allArgs1023
    
g_result regex_match(g_allArgsPATTERNg_returnvalueg_error63
    switch (
g_result) { 
        case 
REGEX_MATCH_FAIL: { 
            
log_amx("REGEX_MATCH_FAIL! %s"g_error
            return 
PLUGIN_CONTINUE 
        

        case 
REGEX_PATTERN_FAIL: { 
            
log_amx("REGEX_PATTERN_FAIL! %s"g_error
            return 
PLUGIN_CONTINUE 
        

        case 
REGEX_NO_MATCH: { 
            return 
PLUGIN_CONTINUE 
        

        default: { 
            if (
get_cvar_num(CVAR_BANVIOLATORS)) { 
                new 
userid get_user_userid(id
                new 
minutesString[10
                
get_cvar_string(CVAR_BANMINUTESminutesString9
                new 
temp[64], banned[16], minutes get_cvar_num(CVAR_BANMINUTES
     
                if (
minutes
                    
format(temp63"%L"id"FOR_MIN"minutesString
                else 
                    
format(temp63"%L"id"PERM"
                 
                
format(banned15"%L"id"BANNED"
     
                new 
authid[32
                
get_user_authid(idauthid31
     
                new 
name[32
                
get_user_name(idname31
                
log_amx("%s (%s), %s %s because of advertising an IP address. This was written: ^"%s^""nameauthidbannedtempg_allArgs
     
                
server_cmd("kick #%d ^"%(%%s)^";wait;banid ^"%d^" ^"%s^";wait;writeid"useridREASONbannedtempminutesauthid)                 
            } 
            else { 
                
ColorMessage(id"Don't type messages with points and other symbol like this!"
                
ColorMessage(id"Don't say IPs!"
            } 
            
regex_free(g_result
            return 
PLUGIN_HANDLED // block msg 
        

    } 
     
    return 
PLUGIN_CONTINUE 




public 
plugin_init() { 
    
register_plugin(PLUGINNAMEVERSIONAUTHOR
     
    
register_clcmd("say""hook_say"
    
register_cvar(CVAR_BANVIOLATORS"0"
    
register_cvar(CVAR_BANMINUTES"30"
     
    
register_dictionary("admincmd.txt"


stock ColorMessage(const id, const input[], any:...){ 
            new 
count 1players[32]; 
            static 
msg191 ]; 
            
vformat(msg190input3); 
            if (
idplayers[0] = id; else get_players(players count "ch"); { 
                for (new 
0counti++){ 
                    if (
is_user_connected(players[i])){ 
                        
message_begin(MSG_ONE_UNRELIABLE get_user_msgid("SayText"), _players[i]); 
                        
write_byte(players[i]); 
                        
write_string(msg); 
                        
message_end();}}} 
        } 
compare two files and find out what's new
SEMO.Pa3x is offline
Send a message via Skype™ to SEMO.Pa3x
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 10-12-2016 , 09:37   Re: Block say ip in server - Block ip - Block ip in chat
Reply With Quote #10

Quote:
Originally Posted by SEMO.Pa3x View Post
compare two files and find out what's new
Yeah, yours there is no indentation: SEMO.Pa3x_block_ip_differences.html

Is good to learn it: I want to code plugins.


PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <fun>
#include <fakemeta>
#include <fakemeta_util>
#include <regex>
#include <colorchat>

#define PLUGIN  "Block IP's [JGHG] + [SEMO.Pa3x]"
#define VERSION "2.0"
#define AUTHOR  "[JGHG] + [SEMO.Pa3x]"

new bool:Gagged33 ];

#define PATTERN           "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
#define CVAR_BANVIOLATORS "ip_banviolators"
new Regex:g_result;
new 
g_returnvalue;
new 
g_error64 ];
new 
g_allArgs1024 ];

public 
plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
register_clcmd"say""hook_say" );
    
register_clcmd"say""Client_Command_Say" );
    
register_clcmd"say_team""Client_Command_Say_Team" );
    
register_concmd"amx_ungag""cmdUnGag"ADMIN_CHAT"[name]" );
}

public 
plugin_modules()
{
    
require_module"regex" );
}

public 
hook_sayidlevelcid )
{
    static 
name32 ];
    
get_cvar_string"hostname"namecharsmaxname ) );
    
read_argsg_allArgs1023 );
    
g_result regex_matchg_allArgsPATTERNg_returnvalueg_error63 );

    switch( 
g_result )
    {
        case 
REGEX_MATCH_FAIL:
        {
            return 
PLUGIN_CONTINUE;
        }

        case 
REGEX_PATTERN_FAIL:
        {
            return 
PLUGIN_CONTINUE;
        }

        case 
REGEX_NO_MATCH:
        {
            return 
PLUGIN_CONTINUE;
        }

        default:
        {
            if( 
get_cvar_numCVAR_BANVIOLATORS ) )
            {
            }
            else
            {
                new 
szname32 ];
                
get_user_nameidszname31 );

                if( 
Gaggedid ] )
                {
                    return 
PLUGIN_HANDLED;
                }

                
Gaggedid ] = true;
                
ColorChat0GREY"^1[SERVER]^4 %s^1: gag^4 %s^1 for^3 all this rounds"nameszname );
                
ColorChat0GREY"^4reason:^1 share ip server" );
            }

            
regex_freeg_result );
            return 
PLUGIN_HANDLED// block msg
        
}

    }
    return 
PLUGIN_CONTINUE;
}

get_targetidArg[] )
{
    new 
player find_player"bl"Arg );

    if( 
player )
    {
        if( 
player != find_player"blj"Arg ) )
        {
            
console_printid"[CS] User not found.." );
            return 
false;
        }
    }
    else if( ( 
player find_player"c"Arg ) ) == && Arg] == '#' && Arg] )
    {
        
player find_player"k"str_to_numArg] ) );
    }

    if( !
player )
    {
        
console_printid"[CS] User not found.." );
    }

    return 
player;
}

public 
cmdUnGagidlevelcid )
{
    if( !
cmd_accessidlevelcid) )
    {
        
ColorChatidGREY"^4[CS]^1 You have no access." );
        return 
PLUGIN_HANDLED;
    }

    new 
arg32 ], admin32 ], player32 ];
    
read_argv1arg31 );
    new 
target get_targetidarg );

    if( !
target )
    {
        return 
PLUGIN_HANDLED;
    }

    
get_user_nameidadmin31 );
    
get_user_nametargetplayer31 );

    if( !
Gaggedtarget ] )
    {
        return 
PLUGIN_HANDLED;
    }

    
Gaggedtarget ] = false;
    
ColorChat0GREY"^1[ADMIN]^4 %s^1: ungag^4 %s"adminplayer );
    
remove_tasktarget );
    return 
PLUGIN_HANDLED;
}

public 
Client_Command_Sayid )
{
    if( !
is_user_connectedid ) )
    {
        return 
PLUGIN_HANDLED_MAIN;
    }

// Gagged
    
if( Gaggedid ] )
    {
        
ColorChatidGREY"^4[CS]^1 You have been^4 muted^1 from use chat..." );
        return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;
}

public 
Client_Command_Say_Teamid )
{
    if( !
is_user_connectedid ) )
    {
        return 
PLUGIN_HANDLED_MAIN;
    }

// Gagged
    
if( Gaggedid ] )
    {
        
ColorChatidGREY"^4[CS]^1 You have been^4 muted^1 from use chat..." );
        return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;

__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz 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 06:29.


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