AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   remove (https://forums.alliedmods.net/showthread.php?t=323561)

Cirovic 04-22-2020 13:30

remove
 
lock

Supremache 04-23-2020 17:25

Re: CT AFK Slayer
 
Quote:

Originally Posted by Cirovic (Post 2695370)
Hello, i need plugin that will slay AFK CT Players, i searched forum and there is no plugin that matches my criterium, so if anyone want to create me this plugin.. thank you..

*Important
i have deathrun server, and on some maps there is afk slayer that moves players in hole to die, and when i tried some afk slayers that moving thing will confuse plugin, like that is player movement.. i hope u understand.. thanks again

AFK TIME = 30
TEAM = ONLY CT

PHP Code:

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

#define TIME 30.0  

new Float:player_origin[33][3];  

public 
plugin_init()  
{  
    
RegisterHam(Ham_Spawn"player""e_Spawn"1);  
}  

public 
e_Spawn(id)  
{
    if(
get_user_team(id) != 2)
        return;
    
remove_task(id)  
    
    if(
is_user_alive(id))  
    {  
        
set_task(0.8"get_spawn"id);  
    }
}  

public 
get_spawn(id)  
{
    
pev(idpev_originplayer_origin[id]);  
    
set_task(TIME"check_afk"id);  
}  

public 
check_afk(id)  
{  
    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
    {  
        if(
same_origin(id))  
        {  
            
user_kill(id);  
            new 
name[33];  
            
get_user_name(idname32);  
            
client_print(0print_chat,  "%s was killed for AFK."name);
        }  
    }  
}  

public 
same_origin(id)  
{  
    new 
Float:origin[3];  
    
pev(idpev_originorigin);  
    for(new 
03i++)  
        if(
origin[i] != player_origin[id][i])  
        return 
0;  
    return 
1;  



Cirovic 04-23-2020 19:32

Re: CT AFK Slayer
 
thanks, but that doesn't kill my afk players.

+ARUKARI- 04-23-2020 19:54

Re: CT AFK Slayer
 
Perhaps you need to detect and count when the button is not pressed.
I'm thinking about it, But someone will complete it before I make it.

Bugsy 04-23-2020 19:58

Re: CT AFK Slayer
 
This will slay if the player is within 10 units of where he spawned after 30 seconds.
PHP Code:


#include <amxmodx> 
#include <fakemeta>

new const Version[] = "0.1";

const 
TaskID 3412231;

new 
Float:g_fOriginMAX_PLAYERS ][ ];  
new 
g_pSlayTime;

public 
plugin_init()  
{  
    
register_plugin"AFK Slay" Version "bugsy" );
    
    
register_logevent"RoundStart" "1=Round_Start" );
    
register_logevent"RoundEnd" "1=Round_End" );
    
    
g_pSlayTime register_cvar"as_slaytime" "30" );
}  

public 
RoundStart()  
{
    new 
iPlayers32 ] , iNum iPlayer;
        
    
get_playersiPlayers iNum "ae" "CT" );
    
    for ( new 
iNum i++ )
    {
        
iPlayer iPlayers];
        
peviPlayer pev_origin g_fOriginiPlayer ] );
    }
    
    
set_taskget_pcvar_floatg_pSlayTime ) , "CheckAFK" TaskID );
}  

public 
RoundEnd()
{
    
remove_taskTaskID );
}

public 
CheckAFK()  
{  
    new 
iPlayers32 ] , iNum iPlayer Float:fOrigin];
        
    
get_playersiPlayers iNum "ae" "CT" );
    
    for ( new 
iNum i++ )
    {
        
iPlayer iPlayers];
        
        
peviPlayer pev_origin fOrigin );
        
        if ( 
get_distance_fg_fOriginiPlayer ] , fOrigin ) <= 10.0 )
            
user_killiPlayer )
    }



Cirovic 04-23-2020 20:01

Re: CT AFK Slayer
 
What about if player doesn't move from spawn point will he be slayed??

Bugsy 04-23-2020 20:03

Re: CT AFK Slayer
 
Yes, if the player does nothing he will be killed after 30 seconds. With the 10 unit thing, if he walked away and then came back and was within 10 units of his spawn location, he would be slayed. Odds are slim, but I guess it could happen. I can add additional code to prevent this.

+ARUKARI- 04-23-2020 20:11

Re: CT AFK Slayer
 
@Bugsy
You work fast everyday. I think you so busy. :)

iclassdon 04-23-2020 20:34

Re: CT AFK Slayer
 
Bugsy = Godlike =)

Cirovic 04-23-2020 21:28

Re: CT AFK Slayer
 
Bugsy what about if he go far from spawn and afk there will he be slayed?


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

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