Raised This Month: $32 Target: $400
 8% 

CS AFK Manager


Post New Thread Reply   
 
Thread Tools Display Modes
fatal_nl
Member
Join Date: Apr 2017
Old 05-07-2017 , 18:39   Re: CS AFK Manager
Reply With Quote #61

EDIT: There's already a HLTV kick protection built in. I did some tests and I think this plugin checks if it's a player before performing actions. All below is inapplicable.

============================================= ======

Can we add HLTV protection to this plugin? (and not being kicked for sitting in SPEC)

PHP Code:
case CS_TEAM_SPECTATORCS_TEAM_UNASSIGNED:
            {
                if ( 
kick_time 0.0 )
                {
                    if ( 
entity_get_int(playerEV_INT_button) & Buttons )
                    {
                        
AfkTime[player] = 0.0
                    
}
                    else
                    {
                        
AfkTime[player] += loop_frequency
                    
}

                    
afk_time AfkTime[player]

                    if ( 
afk_time >= kick_time && ( !kick_immunity || !has_all_flags(playerkick_immunity_flag) ) && ( !kick_spec_only_if_full || players_num >= full_maxplayers ) )
                    {
                        if ( 
kick_spec_only_if_full )
                        {
                            if ( 
afk_time last_kick_time )
                            {
                                
last_kick_id player
                                last_kick_time 
afk_time
                            
}
                        }
                        else
                        {
                            
user_kick(player)
                        }
                    }
                }
            } 
SMA file: https://forums.alliedmods.net/attach...8&d=1467281986


I found a similar plugin which has this: https://forums.alliedmods.net/showthread.php?t=125317

PHP Code:
if (is_user_connected(id) && !is_user_hltv(id)){
                
eTeam cs_get_user_team(id)
                if (
eTeam == CS_TEAM_SPECTATOR || eTeam == CS_TEAM_UNASSIGNED || g_bSpec[id]){

                    
// Counter erhöhen
                    
g_iAFKTime[id]++

                    
// Spec-Kick
                    
if (g_iAFKTime[id] >= g_iKickTime MAX_WARN){
                        
func_kick_player(id)
                    }
                }
            } 
SMA file: https://forums.alliedmods.net/attach...2&d=1312294995

For now I feel too afraid to make this edit myself without help. (in case I mess things up)

Is it something simple like this? (not sure if my old and rusty php skills work for this) And do I need to add (id) behind is_user_hltv or maybe even ()?

PHP Code:
if ( afk_time >= kick_time && ( !kick_immunity || !is_user_hltv || !has_all_flags(playerkick_immunity_flag) ) && ( !kick_spec_only_if_full || players_num >= full_maxplayers ) ) 
If it's really this simple, do I need to add is_user_hltv to this static line?

PHP Code:
static kick_spec_only_if_fullbomb_management_immunityswitch_to_spec_immunitykick_immunitybomb_management_immunity_flag[27

Last edited by fatal_nl; 05-08-2017 at 01:26.
fatal_nl is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 05-09-2017 , 20:15   Re: CS AFK Manager
Reply With Quote #62

Basically the check is here
get_players(players, player_count, "ch")

http://www.amxmodx.org/api/amxmodx/get_players

If you want to use the full feature with your hltv (or if you use some xredirect features), you may need to use afk_full_minus_num

IE : 1 have HLTV reserved slot + 1 Admin reserved slot then you set afk_full_minus_num to 2 (if you use the kick only if full feature).

Last edited by Fr33m@n; 05-09-2017 at 20:34.
Fr33m@n is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 06-02-2017 , 07:10   Re: CS AFK Manager
Reply With Quote #63

just when i thought i'd have to do this too by myself again here u came and saved the day. ty for this.

got a question tho, why would u create an entity instead of a task loop?
entities(especially thinking ones) are very limited and complexe servers which use a lot of them might just not be able to handle 1 more.

also, a suggestion:
to support respawn servers, the afk time should add up while dead too because an afk player will get killed a lot and won't get the chance to meet the default 90 second afk time.
on small maps he can even be killed every 5 seconds or less.
__________________

Last edited by georgik57; 06-02-2017 at 07:49.
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
fatal_nl
Member
Join Date: Apr 2017
Old 07-02-2017 , 15:26   Re: CS AFK Manager
Reply With Quote #64

I need this plugin modified because the following happened when you have bots in the servers:

CT team has 1 human player and 4 bots, human player is AFK: T's getting a message that all remaining CT's are AFK.. T's getting killed by bots on their way to the CT spawn...
fatal_nl is offline
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 08-20-2017 , 10:00   Re: CS AFK Manager
Reply With Quote #65

PHP Code:
AMX Mod X Compiler 1.8.3-dev+4739
Copyright 
(c1997-2006 ITB CompuPhase
Copyright 
(c2004-2013 AMX Mod X Team

Error
Undefined symbol "AutoExecConfig" on line 194
Error
Undefined symbol "get_ent_data" on line 321
Error
Undefined symbol "get_ent_data_entity" on line 421
Error
Undefined symbol "set_ent_data" on line 529

4 Errors
.
Could not locate output file C:\Users\nidal\Desktop\afk_manager_1-8-3.amx (compile failed). 
__________________
Ayman Khaled is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-20-2017 , 12:02   Re: CS AFK Manager
Reply With Quote #66

You need to update your includes.
__________________
Arkshine is offline
Old 08-20-2017, 12:44
Ayman Khaled
This message has been deleted by Ayman Khaled. Reason: nvm, solved.
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 08-21-2017 , 01:41   Re: CS AFK Manager
Reply With Quote #67

I don't know how you deal but updating amxmodx isn't something that hard. It should take nothing more than 20 min.
Fr33m@n is offline
Old 08-21-2017, 05:47
Ayman Khaled
This message has been deleted by Ayman Khaled. Reason: nvm, solved.
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 10:51.


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