Raised This Month: $ Target: $400
 0% 

change plugin Efect to make kick=banip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Crazy47
BANNED
Join Date: Jan 2016
Old 04-20-2017 , 14:36   change plugin Efect to make kick=banip
Reply With Quote #1

Hello Alliedmods , i need a litle Help about changing "server_cmd" from kick client to ban ip client , i hope i get help here .
Code:
#include <amxmodx>
#include <amxmisc>
#include <orpheu>

enum PData
{
    ItemType[ 31 ],
    ItemValue[ 31 ]
}

new iCount[33];
new get[ 600 ];
new iItem , iItemType , PlayerData[ 20 ][ PData ];

public plugin_init()
{
    register_plugin(
        "Freezo aka Spawner",
        "0.1",
        "[fHlds-Detector] v2,v3,v3(patched v4)"
    )

    register_cvar("anti_hldsbuffer", "0.1" , FCVAR_SERVER | FCVAR_SPONLY )

}
public client_connect(id)
{    
	
    new szSteamid[33]
    get_user_authid(id ,szSteamid, charsmax(szSteamid))
    
    if(equal(szSteamid,"STEAM_ID_LAN") || equal(szSteamid, "VALVE_ID_LAN") || is_user_steam(id) )return PLUGIN_HANDLED;
    
    iCount[id] = 0;
    iItemType = 0;
    iItem = 0;

    new OrpheuHook:handlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" );

    new szName[32]
    get_user_name(id, szName,charsmax(szName))	
    
    server_cmd( "user ^"%s^"",szName );
    server_exec();

    OrpheuUnregisterHook( handlePrintf );

    for ( new i = 0 ; i < iItem ; i++ )    iCount[id]++;        



    if(iCount[id] == 7){

        new sIp[32];
        get_user_ip(id, sIp, charsmax(sIp), 1);
    
        server_cmd("kick #%d ^"|| fHlds-Detector || Hlds Buffer Detected^"", get_user_userid(id));
        log_to_file("hldsBuffer.txt", "[ fHlds-Detector ][Name=%s][STEAMID=%s][IP=%s]",szName, szSteamid, sIp);
        iCount[id] = 0;
    
    
    }
    return PLUGIN_CONTINUE;

}
public OrpheuHookReturn:Con_Printf( const fmtGet[], const msgGet[] )
{
    formatex( get , charsmax( get ) , "%s" , msgGet )

    if ( iItemType == 0 )
    {
        copy( PlayerData[ iItem ][ ItemType ] , charsmax( PlayerData[][ ItemType ] ) , get );
        iItemType = 1;
    }
    else
    {
        copy( PlayerData[ iItem++ ][ ItemValue ] , charsmax( PlayerData[][ ItemType ] ) , get );
        iItemType = 0;
    }

    return OrpheuSupercede;
}

// Credits to an unknow author
stock bool:is_user_steam(id)
{
    static dp_pointer;
    if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
    {
        server_cmd("dp_clientinfo %d", id);
        server_exec();
        return (get_pcvar_num(dp_pointer) == 2) ? true : false;
    }
    return false;
}
Crazy47 is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 04-20-2017 , 14:46   Re: change plugin Efect to make kick=banip
Reply With Quote #2

This is for AMX, moved to the appropriate section (you posted in sourcemod scripting section).
__________________
sneaK is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-20-2017 , 14:47   Re: change plugin Efect to make kick=banip
Reply With Quote #3

Quote:
dp_clientinfo
Oh boy here we go.
__________________
gabuch2 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 17:58.


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