Raised This Month: $ Target: $400
 0% 

remove


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-23-2020 , 17:25   Re: CT AFK Slayer
Reply With Quote #2

Quote:
Originally Posted by Cirovic View Post
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;  

Supremache is offline
 


Thread Tools
Display Modes

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:01.


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