Raised This Month: $12 Target: $400
 3% 

AFK plug-in problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Twenty_Cat
Junior Member
Join Date: Feb 2022
Old 01-25-2023 , 06:34   AFK plug-in problem
Reply With Quote #1

In the past, players on my server often used the+duck command to avoid Idle KICK. This plug-in has helped me solve this problem.

But recently I found some problems with this plug-in.

In some maps, players are forced to squat down. Even if they are not in the AFK state, the plug-in will also think that the player is in the AFK state to execute the KICK. Is there any way to solve this problem?
PHP Code:
#include <sourcemod>

int g_iTurnBind[MAXPLAYERS+1], g_iCD[MAXPLAYERS+1];

public 
Plugin myinfo =
{
    
name "Turnbind Restrictor",
    
author "Cruze",
    
description "Kicks the player if player uses turn jump, duck, left, or right bind for more than 15 seconds.",
    
version "1.3",
    
url "http://steamcommunity.com/profiles/76561198132924835"
};

public 
void OnClientPostAdminCheck(int client)
{
    
g_iTurnBind[client] = 120;
    if(!
IsFakeClient(client))
    {
        
CreateTimer(1.0Timer_CheckTurnBindclientTIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action Timer_CheckTurnBind(Handle timerint client)
{
    if(!
client || !IsClientInGame(client))
    {
        return 
Plugin_Stop;
    }
    if(!
IsPlayerAlive(client))
    {
        return 
Plugin_Continue;
    }
    
int buttons GetClientButtons(client)
    if(
buttons IN_LEFT || buttons IN_RIGHT || buttons IN_DUCK || buttons IN_JUMP || buttons IN_ATTACK)
    {
        
DisplayMSG(client);
        
g_iTurnBind[client]--;
    }
    else
    {
        
g_iTurnBind[client] = 120;
    }
    if(
g_iTurnBind[client] <= 0)
    {
        
KickClient(client"Idle");
    }
    return 
Plugin_Continue;
}

void DisplayMSG(int client)
{
    if(
g_iCD[client] <= GetTime())
    {
        
g_iCD[client] = GetTime()+15;
        
PrintToChat(client""g_iTurnBind[client]);
    }

Attached Files
File Type: sp Get Plugin or Get Source (SM_Turnbind.sp - 76 views - 1.3 KB)

Last edited by Twenty_Cat; 01-25-2023 at 06:38.
Twenty_Cat is offline
oqyh
Senior Member
Join Date: May 2019
Location: United Arab Emirates
Old 01-25-2023 , 08:21   Re: AFK plug-in problem
Reply With Quote #2

https://github.com/fdrinv/-RLBlocker
__________________
.:[ >> My Plugins << ]:.

My discord : oqyh
oqyh is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-25-2023 , 08:41   Re: AFK plug-in problem
Reply With Quote #3

Try look another plugin
https://www.sourcemod.net/plugins.ph...tion=&search=1
__________________
Do not Private Message @me
Bacardi is offline
Twenty_Cat
Junior Member
Join Date: Feb 2022
Old 01-25-2023 , 14:29   Re: AFK plug-in problem
Reply With Quote #4

Quote:
Originally Posted by oqyh View Post
How does it work? It doesn't seem to work on my server
Twenty_Cat is offline
Reply


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 04:37.


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