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

Auto Spinning Detector/To help afk manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SilentBr
Veteran Member
Join Date: Jan 2009
Old 05-26-2020 , 17:35   Auto Spinning Detector/To help afk manager
Reply With Quote #1

Hi

Is there any plugin that will detect if a player uses a script to turn the mouse (spinning their head), or walk like an idiot to confuse the afk manager?

I think SMAC auto trigger is not what Im looking for. Anyway, I tried to search this plugin but couldnt find anything related to this.

Thanks.
SilentBr is offline
sirr
Junior Member
Join Date: May 2020
Old 05-26-2020 , 22:05   Re: Auto Spinning Detector/To help afk manager
Reply With Quote #2

Quote:
Originally Posted by SilentBr View Post
Hi

Is there any plugin that will detect if a player uses a script to turn the mouse (spinning their head), or walk like an idiot to confuse the afk manager?

I think SMAC auto trigger is not what Im looking for. Anyway, I tried to search this plugin but couldnt find anything related to this.

Thanks.
If a player is using a script to look around randomly this cannot really be detected. However stuff like +right and +forward can be detected.
sirr is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 05-27-2020 , 16:53   Re: Auto Spinning Detector/To help afk manager
Reply With Quote #3

Quote:
Originally Posted by sirr View Post
If a player is using a script to look around randomly this cannot really be detected. However stuff like +right and +forward can be detected.
You can check if he moves his mouse, i don't know if there's a cheat that send angles changes through mouse.

PHP Code:

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#pragma newdecls required

int g_LastButtonsPressed[MAXPLAYERS 1];
int g_LastTimeMoving[MAXPLAYERS 1];
ConVar g_Cvar_AfkTime;

public 
void OnPluginStart()
{
    
g_Cvar_AfkTime CreateConVar("sm_max_afk_time""30""Maximum time to be AFK."FCVAR_NONEtrue30.0);
    
    
HookEvent("player_spawn"Event_PlayerSpawn);
    
HookEvent("player_death"Event_PlayerDeath);
    
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
OnClientPutInServer(i);
        }
    }
}

public 
void OnMapStart()
{
    
CreateTimer(1.0Timer_AFK_TIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_AFK(Handle timerany data)
{
    
int currentTime GetTime();
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        
        if (
IsPlayerAlive(i))
        {
            
int difference currentTime g_LastTimeMoving[i];
            if (
difference >= g_Cvar_AfkTime.IntValue)
            {
                
PrintToChatAll("%N has been slayed for being AFK too long."i);
                
g_LastTimeMoving[i] = currentTime;
                
ForcePlayerSuicide(i);
            }
            else
            {
                
int timeleft g_Cvar_AfkTime.IntValue difference;
                if (
timeleft <= 10)
                {
                    
PrintToChat(i"You will be slayed if you do not move in %d seconds."timeleft);
                }
            }
        }
    }
}

public 
void OnClientPutInServer(int client)
{
    
g_LastTimeMoving[client] = GetTime();
    
g_LastButtonsPressed[client] = 0;
}

public 
void Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if (!
client)
    {
        return;
    }
    
    
g_LastTimeMoving[client] = GetTime();
}

public 
void Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if (!
client)
    {
        return;
    }
    
    
g_LastTimeMoving[client] = GetTime();
}

public 
void OnPlayerRunCmdPost(int clientint buttonsint impulse, const float vel[3], const float angles[3], int weaponint subtypeint cmdnumint tickcountint seed, const int mouse[2])
{
    
// the client is not afk if he moves his mouse
    
if (mouse[0] || mouse[1])
    {
        
g_LastButtonsPressed[client] = buttons;
        
g_LastTimeMoving[client] = GetTime();
        return;
    }
    
    
// the client is not afk if he press different buttons than last time
    
if (g_LastButtonsPressed[client] != buttons)
    {
        
g_LastButtonsPressed[client] = buttons;
        
g_LastTimeMoving[client] = GetTime();
    }

__________________

Last edited by Ilusion9; 05-27-2020 at 16:55.
Ilusion9 is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 05-28-2020 , 02:11   Re: Auto Spinning Detector/To help afk manager
Reply With Quote #4

Quote:
Originally Posted by sirr View Post
If a player is using a script to look around randomly this cannot really be detected. However stuff like +right and +forward can be detected.
If it's not surf server apply ForceSuicide for +right +left and it would work fine.
__________________
iGANGNAM is offline
SilentBr
Veteran Member
Join Date: Jan 2009
Old 05-30-2020 , 20:18   Re: Auto Spinning Detector/To help afk manager
Reply With Quote #5

Quote:
Originally Posted by Ilusion9 View Post
You can check if he moves his mouse, i don't know if there's a cheat that send angles changes through mouse.
Does this detect auto mouse mover?

Quote:
Originally Posted by iGANGNAM View Post
If it's not surf server apply ForceSuicide for +right +left and it would work fine.
I would like to force sm_afk_spec (client) instead.
SilentBr 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 03:36.


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