This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Generic AFK Kicker Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shonenesa
Junior Member
Join Date: Oct 2016
Old 10-09-2016 , 10:00   Generic AFK Kicker Help
Reply With Quote #1

Hey guys, can someone help me with Generic AFK Kicker plugin, i need a check to be added for ADMIN_BAN so it does not kick admins. I know how to add a check is_user_admin but many players have slots so that does not work for me. Thanks in advance

https://forums.alliedmods.net/showthread.php?p=2874
shonenesa is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 10-09-2016 , 10:35   Re: Generic AFK Kicker Help
Reply With Quote #2

Instead of
if ( is_user_admin(id) )
you use
if ( get_user_flags(id) & ADMIN_BAN )
__________________
Black Rose is offline
shonenesa
Junior Member
Join Date: Oct 2016
Old 10-09-2016 , 10:46   Re: Generic AFK Kicker Help
Reply With Quote #3

@Black Rose thanks for your response, i know that, but where do i put the check? I already tried on client_puttinserver and when player is spawned but that only does the next: if the admin with the ban flag is on the server no afk will be slayed.

I think that check should be in the next line but i don't know how to implement it.

Code:
        if (is_user_alive(i) && is_user_connected(i) && !is_user_bot(i) && !is_user_hltv(i) && g_spawned[i]) {
The next line where is check is_user_admin works great, but i need admin_ban

Code:
        if (is_user_alive(i) && is_user_connected(i)  && !is_user_admin(i) && !is_user_bot(i) && !is_user_hltv(i) &&  g_spawned[i]) {

Last edited by shonenesa; 10-09-2016 at 10:48.
shonenesa is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-09-2016 , 10:52   Re: Generic AFK Kicker Help
Reply With Quote #4

Replace

!is_user_admin(i)

with

!( get_user_flags(i) & ADMIN_BAN )
__________________
Bugsy is offline
shonenesa
Junior Member
Join Date: Oct 2016
Old 10-09-2016 , 15:04   Re: Generic AFK Kicker Help
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
Replace

!is_user_admin(i)

with

!( get_user_flags(i) & ADMIN_BAN )
Works like a charm, thanks
shonenesa 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 08:35.


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