AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Req] Ban Terrorists Who Retry (https://forums.alliedmods.net/showthread.php?t=316309)

Snake. 05-16-2019 18:46

[Req] Ban Terrorists Who Retry
 
If terrorists retry in x seconds, they will be banned for x minutes.

Cvars would be cool:

retry_secs
retry_ban_min

ZaX 05-16-2019 19:51

Re: [Req] Ban Terrorists Who Retry
 
what do you mean retry in x seconds?
here is what you need, but I didnt get the first point

PHP Code:

#include <amxmodx>

new g_Ip[33];
new 
bool:Hackz;
new 
gBanTime;

public 
plugin_init( )
{
    
register_plugin("Terrorist Disconnecter Ban""0.2""Craxor");

    
gBanTime register_cvar"retry_ban_min""5" );
    
Hackz true;

}

public 
client_putinserverid )
{
    if( 
is_user_connectedid ) )
    {
        new 
szUserIp[33];
        
get_user_ipidszUserIpcharsmaxszUserIp ), );

        
copyg_Ip[id], charsmaxg_Ip ), szUserIp );
    }
}

public 
plugin_end( )
    
Hackz false;


public 
client_disconnectid 
{
    if( 
get_user_teamid ) == && Hackz == true )
        
server_cmd("amx_addban %s %i Tero-Retry-Reason "g_Ip[id], get_pcvar_numgBanTime ) );



redivcram 05-16-2019 19:57

Re: [Req] Ban Terrorists Who Retry
 
PHP Code:

new const TASK_FORBID_RETRY 49736;
new 
cvarRetrySecscvarRetryBanMin;

public 
plugin_init()
{
    
register_plugin("Ban Terrorist on Retry""1.0.0""^Cram");
    
    
register_event("ResetHUD""event_resetHUD""b");
    
register_logevent("logEvent_roundEnd"2"1=Round_End")
    
    
cvarRetrySecs register_cvar("retry_secs""10");
    
cvarRetryBanMin register_cvar("retry_ban_min""5");
}

public 
client_disconnect(id)
{
    if(
get_user_team(id) == && !task_exists(TASK_FORBID_RETRY))
    {
        new 
authID[32];
        
get_user_authid(idauthIDcharsmax(authID));
        
        
server_cmd("amx_addban %s %d ""No retry after %f secs!"""authIDget_pcvar_num(cvarRetryBanMin), get_pcvar_float(cvarRetrySecs));
    }
}

public 
event_resetHUD()
{
    
set_task(get_pcvar_float(cvarRetrySecs), "forbidRetryForTerrorists"TASK_FORBID_RETRY);
}

public 
logEvent_roundEnd()
{
    if(
task_exists(TASK_FORBID_RETRY))
        
remove_task(TASK_FORBID_RETRY);
}

public 
forbidRetryForTerrorists()
{
    return 
PLUGIN_HANDLED;



Snake. 05-17-2019 11:43

Re: [Req] Ban Terrorists Who Retry
 
Quote:

Originally Posted by redivcram (Post 2651941)
PHP Code:

new const TASK_FORBID_RETRY 49736;
new 
cvarRetrySecscvarRetryBanMin;

public 
plugin_init()
{
    
register_plugin("Ban Terrorist on Retry""1.0.0""^Cram");
    
    
register_event("ResetHUD""event_resetHUD""b");
    
register_logevent("logEvent_roundEnd"2"1=Round_End")
    
    
cvarRetrySecs register_cvar("retry_secs""10");
    
cvarRetryBanMin register_cvar("retry_ban_min""5");
}

public 
client_disconnect(id)
{
    if(
get_user_team(id) == && !task_exists(TASK_FORBID_RETRY))
    {
        new 
authID[32];
        
get_user_authid(idauthIDcharsmax(authID));
        
        
server_cmd("amx_addban %s %d ""No retry after %f secs!"""authIDget_pcvar_num(cvarRetryBanMin), get_pcvar_float(cvarRetrySecs));
    }
}

public 
event_resetHUD()
{
    
set_task(get_pcvar_float(cvarRetrySecs), "forbidRetryForTerrorists"TASK_FORBID_RETRY);
}

public 
logEvent_roundEnd()
{
    if(
task_exists(TASK_FORBID_RETRY))
        
remove_task(TASK_FORBID_RETRY);
}

public 
forbidRetryForTerrorists()
{
    return 
PLUGIN_HANDLED;



I can't compile it.

Fuck For Fun 05-17-2019 12:05

Re: [Req] Ban Terrorists Who Retry
 
Quote:

Originally Posted by Snake. (Post 2652013)
I can't compile it.

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Ban Terrorist on Retry"
#define VERSION "1.0.0"
#define AUTHOR "^Cram"

new const TASK_FORBID_RETRY 49736;
new 
cvarRetrySecscvarRetryBanMin;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_new_round""a""1=0""2=0")  
    
register_logevent("logEvent_roundEnd"2"1=Round_End")
    
    
cvarRetrySecs register_cvar("retry_secs""10");
    
cvarRetryBanMin register_cvar("retry_ban_min""5");
}

public 
client_disconnect(id)
{
    if(
get_user_team(id) == && !task_exists(TASK_FORBID_RETRY))
    {
        new 
authID[32];
        
get_user_authid(idauthIDcharsmax(authID));
        
        
server_cmd("amx_addban %s %d ^"No retry after %f secs!^""authIDget_pcvar_num(cvarRetryBanMin), get_pcvar_float(cvarRetrySecs));
    }
}

public 
event_new_round()
{
    
set_task(get_pcvar_float(cvarRetrySecs), "forbidRetryForTerrorists"TASK_FORBID_RETRY);
}

public 
logEvent_roundEnd()
{
    if(
task_exists(TASK_FORBID_RETRY))
        
remove_task(TASK_FORBID_RETRY);
}

public 
forbidRetryForTerrorists()
{
    return 
PLUGIN_HANDLED;



edon1337 05-17-2019 13:00

Re: [Req] Ban Terrorists Who Retry
 
Why are you using ResetHUD? Simply use
PHP Code:

register_event("HLTV""event_new_round""a""1=0""2=0"

ResetHUD is called on player spawn, when a player connects, when someone uses "fullupdate" client command, demo recording and on round restart attempt.

redivcram 05-17-2019 13:09

Re: [Req] Ban Terrorists Who Retry
 
Quote:

Originally Posted by edon1337 (Post 2652028)
Why are you using ResetHUD? Simply use
PHP Code:

register_event("HLTV""event_new_round""a""1=0""2=0"

ResetHUD is called on player spawn, when a player connects, when someone uses "fullupdate" client command, demo recording and on round restart attempt.

I had no idea ResetHUD is being called from multiple sources.

Snake. 05-19-2019 05:47

Re: [Req] Ban Terrorists Who Retry
 
Quote:

Originally Posted by Fuck For Fun (Post 2652019)
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Ban Terrorist on Retry"
#define VERSION "1.0.0"
#define AUTHOR "^Cram"

new const TASK_FORBID_RETRY 49736;
new 
cvarRetrySecscvarRetryBanMin;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_new_round""a""1=0""2=0")  
    
register_logevent("logEvent_roundEnd"2"1=Round_End")
    
    
cvarRetrySecs register_cvar("retry_secs""10");
    
cvarRetryBanMin register_cvar("retry_ban_min""5");
}

public 
client_disconnect(id)
{
    if(
get_user_team(id) == && !task_exists(TASK_FORBID_RETRY))
    {
        new 
authID[32];
        
get_user_authid(idauthIDcharsmax(authID));
        
        
server_cmd("amx_addban %s %d ^"No retry after %f secs!^""authIDget_pcvar_num(cvarRetryBanMin), get_pcvar_float(cvarRetrySecs));
    }
}

public 
event_new_round()
{
    
set_task(get_pcvar_float(cvarRetrySecs), "forbidRetryForTerrorists"TASK_FORBID_RETRY);
}

public 
logEvent_roundEnd()
{
    if(
task_exists(TASK_FORBID_RETRY))
        
remove_task(TASK_FORBID_RETRY);
}

public 
forbidRetryForTerrorists()
{
    return 
PLUGIN_HANDLED;



It does not work!

Fuck For Fun 05-19-2019 06:08

Re: [Req] Ban Terrorists Who Retry
 
Quote:

Originally Posted by Snake. (Post 2652265)
It does not work!

Logs ERROR?

Snake. 05-19-2019 08:43

Re: [Req] Ban Terrorists Who Retry
 
Quote:

Originally Posted by Fuck For Fun (Post 2652267)
Logs ERROR?

No plugins works but does not ban the player's authid fully.


All times are GMT -4. The time now is 20:57.

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