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

SpeedHack Detector v2 [All]


Post New Thread Reply   
 
Thread Tools Display Modes
Vechta
Veteran Member
Join Date: Jun 2010
Old 10-16-2010 , 03:37   Re: SpeedHack Detector v2 [All]
Reply With Quote #181

What if player using LongJump ?
Vechta is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-01-2010 , 14:17   Re: SpeedHack Detector v2 [All]
Reply With Quote #182

Can someone confirm the plugin is working as expected ?
__________________
Arkshine is offline
Rossonero
Senior Member
Join Date: Mar 2009
Location: Location
Old 11-01-2010 , 15:26   Re: SpeedHack Detector v2 [All]
Reply With Quote #183

I will try it in a few days, gotta find cheats and will test it with bots (to see a full server), maybe ask some friends that will have lag to join, and see hot it behaves

I don't have a steam only server for test purposes, so if it doesn't like nonsteam at all, sorry, not willing to use cheats against people, only bots
__________________
signature
Rossonero is offline
hcxx
Senior Member
Join Date: Jan 2007
Location: 127.0.0.1
Old 11-17-2010 , 07:29   Re: SpeedHack Detector v2 [All]
Reply With Quote #184

when do you add Emp0wer method to your plugin?
hcxx is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 11-20-2010 , 14:09   Re: SpeedHack Detector v2 [All]
Reply With Quote #185

Quote:
Originally Posted by hcxx View Post
when do you add Emp0wer method to your plugin?
Unfortunately I do not have time for scripting anymore. Too busy with collage.

Quote:
Originally Posted by Emp0wer View Post
I have an idea to turn it into "Block SpeedHack".
Hi Emp0wer, please take over this plugin and maintain it, I do not have time to code anymore.
Hope that will turn out nicely!
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Kont
Member
Join Date: Jan 2009
Old 11-26-2010 , 22:25   Re: SpeedHack Detector v2 [All]
Reply With Quote #186

Quote:
Originally Posted by Emp0wer View Post

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define add_alive_property(%1)                        gBS_cl_alive |= (1<<(%1 - 1))
#define del_alive_property(%1)                        gBS_cl_alive &= ~(1<<(%1 - 1))
#define has_alive_property(%1)                        (gBS_cl_alive & (1<<(%1 - 1)))

const gC_CmdsLimit 110
const gC_MaxIdle =  2500
const gC_MaxSlots 32

new gBS_cl_alive
new gPV_logbans

new speed[gC_MaxSlots 1]
new 
gCLI_count[gC_MaxSlots 1]
new 
gCLI_buttons[gC_MaxSlots 1]
new 
gCLI_idlecount[gC_MaxSlots 1
new 
Float:gCLF_lasttime[gC_MaxSlots 1]
new 
Float:gCLV_views[gC_MaxSlots 1][3]
new 
Float:gCLV_pviews[gC_MaxSlots 1][3]

public 
plugin_init()
{
    
register_plugin("Block Speed Hack""Testing version""OT & Empower")
    
    
register_cvar("bsh_version""testing"FCVAR_SERVER FCVAR_SPONLY)
    
    
RegisterHam(Ham_Spawn"player""pfw_PlayerHandleAD"1)
    
RegisterHam(Ham_Killed"player""pfw_PlayerHandleAD"1)
    
    
register_forward(FM_CmdStart"pfw_CmdStart",1)
}

public 
client_connect(id)
    
client_cmd(id,"developer 0")

public 
client_putinserver(id)
    
del_alive_property(id)

public 
client_disconnect(id)
{
    
speed[id] = 0
    del_alive_property
(id)
}

public 
pfw_CmdStart(idpUCseed)
{
    if (!
has_alive_property(id))
        return 
FMRES_IGNORED    
        
    
static old_packets[33]
    
old_packets[id] = gCLI_idlecount[id]
    
    static 
Float:gametimeFloat:gametime_oldFloat:pack_a_sec
    gametime_old 
gametime
    gametime 
get_gametime()
    
pack_a_sec 1.0/gametime-gametime_old
    
    
new Float:fGameTimeiButtons
    
new Float:vView[3]
    
    
pev(idpev_v_anglevView)
    
fGameTime get_gametime()
    
get_uc(pUCUC_ButtonsiButtons)
        
    if (
gCLI_count[id] > 0)
    {
        if (
gCLI_buttons[id] == iButtons)
        {
            if (
gCLV_pviews[id][0] == vView[0] && gCLV_pviews[id][1] == vView[1] && gCLV_pviews[id][2] == vView[2])
                
gCLI_idlecount[id]++
            else
                
gCLI_idlecount[id] = 0
            
            
if (gCLI_idlecount[id] > gC_MaxIdle)
            {
                
gCLV_views[id][0] == -8000.0
                gCLI_idlecount
[id] = 0
            
}
        }
        else
        {
            
gCLI_idlecount[id] = 0
            gCLI_buttons
[id] = iButtons
        
}
        
        
gCLV_pviews[id][0] = vView[0]
        
gCLV_pviews[id][1] = vView[1]
        
gCLV_pviews[id][2] = vView[2]
    }
    
    if (
gCLI_count[id] < 0)
    {
        
gCLI_idlecount[id] = 0
        gCLI_buttons
[id] = iButtons
        gCLV_pviews
[id][0] = vView[0]
        
gCLV_pviews[id][1] = vView[1]
        
gCLV_pviews[id][2] = vView[2]
    }
    
    if (
gCLV_views[id][0] == -8000.0 && gCLI_count[id] != -9)
    {
        
gCLI_count[id] = -9
        
        
if(gCLI_idlecount[id]-old_packets[id]*pack_a_sec>110)
        {
            
set_uc(pUCUC_Buttons0)
            
            static 
Float:c_speed
            pev
(id,pev_maxspeed,c_speed);
            
            if(
c_speed>1.0)
            {
                
speed[id] = c_speed
            
                set_pev
(idpev_velocityFloat:{0.0,0.0,0.0}) // stop motion
                
set_pev(idpev_maxspeed1.0// prevent from moving
            
}
        }
        else if(
speed[id])
        {
            
set_pev(idpev_maxspeedspeed[id])
            
speed[id] = 0;
        }
        
        return 
FMRES_IGNORED
    
}
    
    if (
gCLI_count[id] < -2)
    {
        
gCLI_buttons[id] =  iButtons
        gCLV_views
[id][0] = vView[0]
        
gCLV_views[id][1] = vView[1]
        
gCLV_views[id][2] = vView[2]
        
gCLI_count[id]++
        
        if(
gCLI_idlecount[id]-old_packets[id]*pack_a_sec>110)
        {
            
set_uc(pUCUC_Buttons0)
            
            static 
Float:c_speed
            pev
(id,pev_maxspeed,c_speed);
            
            if(
c_speed>1.0)
            {
                
speed[id] = c_speed
            
                set_pev
(idpev_velocityFloat:{0.0,0.0,0.0}) // stop motion
                
set_pev(idpev_maxspeed1.0// prevent from moving
            
}
        }
        else if(
speed[id])
        {
            
set_pev(idpev_maxspeedspeed[id])
            
speed[id] = 0;
        }
        
        return 
FMRES_IGNORED
    
}
    
    
// If the user has begun targeting players
    
if (gCLV_views[id][0] == vView[0] && gCLV_views[id][1] == vView[1] && gCLV_views[id][2] == vView[2])
    {
        
gCLI_count[id] = -2
        
        
if(gCLI_idlecount[id]-old_packets[id]*pack_a_sec>110)
        {
            
set_uc(pUCUC_Buttons0)
            
            static 
Float:c_speed
            pev
(id,pev_maxspeed,c_speed);
            
            if(
c_speed>1.0)
            {
                
speed[id] = c_speed
            
                set_pev
(idpev_velocityFloat:{0.0,0.0,0.0}) // stop motion
                
set_pev(idpev_maxspeed1.0// prevent from moving
            
}
        }
        else if(
speed[id])
        {
            
set_pev(idpev_maxspeedspeed[id])
            
speed[id] = 0;
        }
        
        return 
FMRES_IGNORED
    
}
    
    if (
fGameTime gCLF_lasttime[id] > 1.0)
    {
        
//if (gCLI_count[id] > gC_MaxLimit)
        //    punish_player(id)
        
        
if (gCLI_count[id] < 0)
            
gCLI_count[id] ++
        else
            
gCLI_count[id] = 0
        
        gCLF_lasttime
[id] = fGameTime
        
        
if(gCLI_idlecount[id]-old_packets[id]*pack_a_sec>110)
        {
            
set_uc(pUCUC_Buttons0)
            
            static 
Float:c_speed
            pev
(id,pev_maxspeed,c_speed);
            
            if(
c_speed>1.0)
            {
                
speed[id] = c_speed
            
                set_pev
(idpev_velocityFloat:{0.0,0.0,0.0}) // stop motion
                
set_pev(idpev_maxspeed1.0// prevent from moving
            
}
        }
        else if(
speed[id])
        {
            
set_pev(idpev_maxspeedspeed[id])
            
speed[id] = 0;
        }
        
        return 
FMRES_IGNORED
    
}
    
    if (
gCLI_count[id] >= 0)
        
gCLI_count[id]++;
        
    if(
gCLI_idlecount[id]-old_packets[id]*pack_a_sec>110)
    {
        
set_uc(pUCUC_Buttons0)
            
        static 
Float:c_speed
        pev
(id,pev_maxspeed,c_speed);
            
        if(
c_speed>1.0)
        {
            
speed[id] = c_speed
            
            set_pev
(idpev_velocityFloat:{0.0,0.0,0.0}) // stop motion
            
set_pev(idpev_maxspeed1.0// prevent from moving
        
}
    }
    else if(
speed[id])
    {
        
set_pev(idpev_maxspeedspeed[id])
        
speed[id] = 0;
    }

    return 
FMRES_IGNORED
}

public 
pfw_PlayerHandleAD(id)
{
    if (
is_user_alive(id))
    {    
        
gCLF_lasttime[id] = get_gametime()
        
gCLV_views[id][0] = -8000.0
        gCLI_idlecount
[id] = 0
        
        add_alive_property
(id)
    }
    else
        
del_alive_property(id)
    
    return 
HAM_IGNORED


Compiling error:

Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

blockspeed.sma(116 -- 117) : warning 213: tag mismatch
blockspeed.sma(147 -- 14 : warning 213: tag mismatch
blockspeed.sma(175 -- 176) : warning 213: tag mismatch
blockspeed.sma(210 -- 211) : warning 213: tag mismatch
blockspeed.sma(236 -- 237) : warning 213: tag mismatch
Header size: 784 bytes
Code size: 8860 bytes
Data size: 2556 bytes
Stack/heap size: 16384 bytes; estimated max. usage=42 cells (168 bytes)
Total requirements: 28584 bytes

5 Warnings.
Done.

Could you make it correct?
Kont is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-07-2011 , 01:26   Re: SpeedHack Detector v2 [All]
Reply With Quote #187

Quote:
Originally Posted by Arkshine View Post
Can someone confirm the plugin is working as expected ?
???


The code is ok to approve the plugin, are results free from false positive, does the plugin work as expected ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
inasoulvoid
New Member
Join Date: Jan 2011
Old 01-29-2011 , 04:17   Re: SpeedHack Detector v2 [All]
Reply With Quote #188

Code:
--- speedhack_detector.sma    2010-09-22 19:28:01 +0400
+++ speedhack_detector_fixed.sma    2011-02-01 18:40:47 +0300
@@ -132,7 +132,7 @@
     
     pev(id, pev_v_angle, vView)
     fGameTime = get_gametime()
-    get_uc(pUC, UC_Buttons, iButtons)
+    iButtons = get_uc(pUC, UC_Buttons)
     
     if (gCLI_count[id] > 0)
     {
@@ -268,11 +268,13 @@
                 if( ++counter > 1 ) 
                 { 
                     kick_user(id, "Kicked by Speed Hack Detector", "Reason: You cannot play with developer different than 0", "To connect set developer to 0 and leave it that way or else you will be banned.")
+                    break
                 } 
             } 
             else 
             { 
                 kick_user(id, "Kicked by Speed Hack Detector", "Reason: You cannot play with developer different than 0", "To connect set developer to 0 and leave it that way or else you will be banned.")
+                break
             } 
         } 
     }
@@ -338,14 +340,14 @@
     formatex(message, charsmax(message), "[SHD] Name: %s | Steam ID: %s | Counts: %d | Ping: %d | Loss: %d", name, steamid, gCLI_count[id], gCLI_ping[id], gCLI_loss[id])
     
     if (get_pcvar_num(gPV_logbans))
-        log_to_file("shd_bans.log", message)
+        log_to_file("shd_bans.log", "%s", message)
     
-    console_print(0, message)
+    server_print("%s", message)
     
     if (get_pcvar_num(gPV_adminonly))
         print_toadmin(name)
     else
-        client_print(0, print_chat, "[SHD] Player %s", name, (0 < get_pcvar_num(gPV_punishtype) <= 4) ? "was banned because of the speed hack": "has been detected using speed hack")
+        client_print(0, print_chat, "[SHD] Player %s %s", name, (0 < get_pcvar_num(gPV_punishtype) <= 4) ? "was banned because of the speed hack": "has been detected using speed hack")
     
     return 1
 }
@@ -360,7 +362,7 @@
         id = players[i]
         
         if (get_user_flags(id) & ADMIN_CHAT)
-            client_print(id, print_chat, "[SHD][Admin] Player %s", name, (0 < get_pcvar_num(gPV_punishtype) <= 4) ? "was banned because of the speed hack": "has been detected using speed hack")
+            client_print(id, print_chat, "[SHD][Admin] Player %s %s", name, (0 < get_pcvar_num(gPV_punishtype) <= 4) ? "was banned because of the speed hack": "has been detected using speed hack")
     }
 }
no english, no comments, sorry
Attached Files
File Type: patch speedhack_detector.patch (2.1 KB, 117 views)

Last edited by inasoulvoid; 02-01-2011 at 10:45. Reason: new bugs found =)
inasoulvoid is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 01-31-2011 , 22:45   Re: SpeedHack Detector v2 [All]
Reply With Quote #189

This plugin. Didn't Work with me
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-01-2011 , 02:00   Re: SpeedHack Detector v2 [All]
Reply With Quote #190

Quote:
Originally Posted by ot_207 View Post
Hi Emp0wer, please take over this plugin and maintain it, I do not have time to code anymore.
Unapproved.


Also, when you read this, you could at least fix #188 pointed error
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 23:20.


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