Raised This Month: $ Target: $400
 0% 

remove


Post New Thread Reply   
 
Thread Tools Display Modes
lantimilan
Senior Member
Join Date: May 2016
Old 04-29-2020 , 07:21   Re: CT AFK Slayer
Reply With Quote #41

@Bugsy its possible when kill in spec dont show negative score -1, -10 but to restart when kill from
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
lantimilan is offline
Send a message via MSN to lantimilan
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-29-2020 , 21:24   Re: CT AFK Slayer
Reply With Quote #42

Ok..
__________________
Bugsy is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 05-13-2020 , 07:47   Re: CT AFK Slayer
Reply With Quote #43

There is issue with player who are afk and holding W, i had issue with player on one map where is no suicide, he programmed CS or something to hold W and he is just going into wall and aint get slay, people waiting 15 minutes and then i got report. I can fix this maybe with walkguard on some of maps, but i need to create zones, etc... Can it be fixed somehow with this plugin or i need walkguard?
sanimare is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-13-2020 , 08:18   Re: CT AFK Slayer
Reply With Quote #44

Does this even tell them what they are doing is wrong? Misread. He wants CT only!
__________________

Last edited by DJEarthQuake; 05-16-2020 at 09:53.
DJEarthQuake is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2020 , 10:41   Re: CT AFK Slayer
Reply With Quote #45

I can add logic where if the same button is held indefinitely they are considered afk.
__________________
Bugsy is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 05-13-2020 , 11:38   Re: CT AFK Slayer
Reply With Quote #46

Quote:
Originally Posted by Bugsy View Post
I can add logic where if the same button is held indefinitely they are considered afk.
And for 2 days they will update bot with w+a..
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2020 , 17:26   Re: CT AFK Slayer
Reply With Quote #47

This would cover any combination of buttons, using the pev_buttons bitsum.
__________________
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2020 , 19:43   Re: CT AFK Slayer
Reply With Quote #48

Hardly tested. There's a new cvar that holds the minimum distance threshold that must occur: as_distancethreshold. The units add up quickly with movement so 100k to 200k should be plenty, lower it to make it more strict. Distance traveled is reset at spawn. If distance traveled < threshold distance and time last moved >= as_slaytime seconds, then slay.
PHP Code:

#include <amxmodx> 
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new const Version[] = "0.6";

#define MAX_PLAYERS 32

const ButtonBits = ( IN_FORWARD IN_BACK IN_MOVELEFT IN_MOVERIGHT IN_JUMP IN_DUCK IN_USE IN_ATTACK IN_ATTACK2 IN_SCORE );

enum PlayerData
{
    
Float:DistanceTraveled,
    
LastMoveTime,
    
LastPositionChange,
    
SlayCount
}

new 
g_pdDataMAX_PLAYERS ][ PlayerData ] , Float:g_fLastOriginMAX_PLAYERS ][ ];  
new 
g_iSysTime bool:g_bInRound;
new 
g_pSlayTime g_pSlayMode g_pSpecSlays g_pVerboseMode g_pDistanceThreshold g_pFreezeTime;

public 
plugin_init()  
{  
    
register_plugin"AFK Slay" Version "bugsy" );

    
g_pSlayTime register_cvar"as_slaytime" "30" );
    
g_pSlayMode register_cvar"as_slaymode" "2" );
    
g_pSpecSlays register_cvar"as_spectatorslays" "5" );
    
g_pVerboseMode register_cvar"as_verbosemode" "1" );
    
g_pDistanceThreshold register_cvar"as_distancethreshold" "100000" );
    
    
g_pFreezeTime get_cvar_pointer"mp_freezetime" );
    
    
RegisterHamHam_Spawn "player" "HamSpawn_Post" true );
    
register_forwardFM_CmdStart "CmdStart" );
    
register_logevent"RoundStart" "1=Round_Start" );
    
register_logevent"RoundEnd" "1=Round_End" );
    
    
set_task1.0 "CheckAFK" , .flags="b" );
}  

public 
client_connectid )
{
    
g_pdDataid ][ SlayCount ] = 0;
}

public 
HamSpawn_PostiPlayer )
{
    if ( 
is_user_aliveiPlayer ) )
    {
        
peviPlayer pev_origin g_fLastOriginiPlayer ] );
        
g_pdDataiPlayer ][ DistanceTraveled ] = 0.0;
        
        
g_pdDataiPlayer ][ LastMoveTime ] = g_iSysTime + ( g_bInRound get_pcvar_numg_pFreezeTime ) );
        
g_pdDataiPlayer ][ LastPositionChange ] = g_pdDataiPlayer ][ LastMoveTime ];
    }
}

public 
RoundStart()
{
    
g_bInRound true;
}

public 
RoundEnd()
{
    
g_bInRound false;
}

public 
CmdStartid handle seed )
{
    static 
Float:fOrigin];
    
    if ( 
g_bInRound && ( get_uchandle UC_Buttons ) & ButtonBits ) )
    {
        if ( 
g_fLastOriginid ][ ] )
        {
            
pevid pev_origin fOrigin );
            
            if ( ( 
g_fLastOriginid ][ ] != fOrigin] ) || ( g_fLastOriginid ][ ] != fOrigin] ) )
            {
                
g_pdDataid ][ LastPositionChange ] = get_systime();
            }
            
            
g_pdDataid ][ DistanceTraveled ] += get_distance_fg_fLastOriginid ] , fOrigin );
        }
        
        
g_pdDataid ][ LastMoveTime ] = g_iSysTime;
        
g_pdDataid ][ SlayCount ] = 0;
    }
}  

public 
CheckAFK()  
{  
    new 
iPlayers32 ] , iNum iPlayer szName[32 ] , iSlayPos iSpecPos iVerbose iSlayTime;
    static 
szSlayNames512 ] , szSpecNames512 ];
    
    
iVerbose get_pcvar_numg_pVerboseMode );
    
g_iSysTime get_systime();
    
iSlayTime get_pcvar_numg_pSlayTime );
    
    switch ( 
get_pcvar_numg_pSlayMode ) )
    {
        case 
1get_playersiPlayers iNum "ae" "TERRORIST" );
        case 
2get_playersiPlayers iNum "ae" "CT" );
        default: 
get_playersiPlayers iNum "a" );
    }
    
    
szSlayNames] = EOS;
    
szSpecNames] = EOS;
    
    for ( new 
iNum i++ )
    {
        
iPlayer iPlayers];
        
peviPlayer pev_origin g_fLastOriginiPlayer ] );
        
        if ( 
g_pdDataiPlayer ][ LastMoveTime ] )
        {
            if ( 
                ( ( 
g_iSysTime g_pdDataiPlayer ][ LastMoveTime ] ) >= iSlayTime ) || 
                ( ( 
g_pdDataiPlayer ][ DistanceTraveled ] < get_pcvar_numg_pDistanceThreshold ) ) && ( g_iSysTime g_pdDataiPlayer ][ LastPositionChange ] ) >= iSlayTime ) )
            {
                
user_killiPlayer );
                
                if ( 
iVerbose )
                    
get_user_nameiPlayer szName charsmaxszName ) );
                
                if ( ++
g_pdDataiPlayer ][ SlayCount ]  >= get_pcvar_numg_pSpecSlays ) )
                {
                    
cs_set_user_teamiPlayer CS_TEAM_SPECTATOR );
                    
                    if ( 
iVerbose )
                        
iSpecPos += formatexszSpecNamesiSpecPos ] , charsmaxszSpecNames ) - iSpecPos "%s^n" szName );
                }
                else
                {
                    if ( 
iVerbose )
                        
iSlayPos += formatexszSlayNamesiSlayPos ] , charsmaxszSlayNames ) - iSlayPos "%s^n" szName );
                }
            }
        }
    }
    
    if ( 
iVerbose && ( iSlayPos || iSpecPos ) )
    {
        
set_hudmessage255 255 255 0.05 0.3 0.0 3.0 );
        
show_hudmessage"%s%s%s%s" iSlayPos "AFK - Slayed:^n^n" "" szSlayNames iSpecPos "AFK - Slayed / Moved to Spec:^n^n" "" szSpecNames );
    }

__________________

Last edited by Bugsy; 05-13-2020 at 21:18.
Bugsy is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-16-2020 , 09:56   Re: CT AFK Slayer
Reply With Quote #49

Code:
///mp_autoslay aims to be like mp_autokick except it slays. Zero is off and the higher the number the greater the time in between checks. #include amxmodx #include amxmisc #include engine_stocks #include fakemeta #define MAX_PLAYERS 32 new g_cvar_mp_autoslay; public plugin_init() {   register_plugin("Simple AFK/Camper maimer","A",".sρiηX҉.");   register_forward(FM_UpdateClientData, "@fw_UpdateClientData")      #if AMXX_VERSION_NUM < 183;         g_cvar_mp_autoslay = register_cvar("mp_autoslay", "15");         #else     g_cvar_mp_autoslay = create_cvar("mp_autoslay", "15", .description = "Number of seconds between AFK checks", .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 60.0);   #endif } @fw_UpdateClientData(id,Float:vec[3]) {  #define IS_THERE (~(1<<IN_SCORE))  if(get_pcvar_num(g_cvar_mp_autoslay) >= 1 && is_user_alive(id) || is_user_bot(id))   if( (pev(id, pev_button) & IS_THERE) && (pev(id, pev_oldbuttons) & IS_THERE) && (get_user_velocity(id, vec) != 0.0) ){     if( task_exists(id) )remove_task(id)     }     else  set_task(float(get_pcvar_num(g_cvar_mp_autoslay)), "@handle_afk", id); } @handle_afk(id, name[MAX_PLAYERS +1]) {  new team[32];  get_user_team(id, team, charsmax(team)) /*if (containi(team, "CT") != -1 )//uncomment to check CT only.*/  if(is_user_alive(id) &&  get_pcvar_num(g_cvar_mp_autoslay)){        new Float:task_time = get_pcvar_num(g_cvar_mp_autoslay)*0.50        change_task(id,task_time, 0);        client_print(id,print_center, "AFK/Camping not allowed!");        if(task_time > 6.0){          get_user_name(id,name,charsmax (name));          client_print(0,print_chat,"%s is camping or is AFK! We are killing them slowly.",name);          }         #define RANDOM_FAKE_DAMAGES (1<<random(23))        #define RANDOM_HP random_float(15.0,25.0)       fakedamage(id,"camping out AFK",RANDOM_HP,RANDOM_FAKE_DAMAGES);    } }
__________________

Last edited by DJEarthQuake; 05-16-2020 at 14:34.
DJEarthQuake is offline
sanimare
Senior Member
Join Date: Sep 2010
Old 05-16-2020 , 15:01   Re: CT AFK Slayer
Reply With Quote #50

Same slay method, by seconds, if is deathrun or bhop and you are doing bhop or something similar, i don't want be considered as afk. Btw thank's for updating, will test.
sanimare 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 09:02.


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