Raised This Month: $ Target: $400
 0% 

Keys are disabled in the game. Is is possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blue zebra
BANNED
Join Date: Jun 2010
Old 08-18-2010 , 03:42   Keys are disabled in the game. Is is possible?
Reply With Quote #1

Keys are disabled in the game. Is it possible?
For example: INS and DEL keys. (hotkeys for some cheats menu).
How? Someone can help me?

Than here, but other key buttons and a single use can lead to kick or ban.
In the example of a similar script, but for other purposes. (Anyway this script did not work for me)

Code:
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
{    name = "SpinHack Detectir",
    author = "SAMURAI",
    description = "catch spinhack",
    version = "1.0",
    url = "www.cs-utilz.net"
}

#define MaxAngelChange 1500
#define MAX_DETECTIONS 25

#define PLAYER_LEFT 128
// Player is holdign down the left  button
#define PLAYER_RIGHT 256
// Player is holdign down the right button

new Float:gf_LastAng[MAXPLAYERS+1][3];
new Float:gf_TotalAng[MAXPLAYERS+1];
new g_Detections[MAXPLAYERS+1] ;

new g_iMaxClients;

public OnPluginStart()
{
    g_iMaxClients = GetMaxClients();

    CreateTimer(1.0,check_for_spinhack,_,TIMER_REPEAT);
    CreateTimer(0.1,FakePrethink,0,TIMER_REPEAT);

}

public Action:check_for_spinhack(Handle:timer)
{
    for(new i = 1; i <= g_iMaxClients; i++)
    {
        if(IsPlayerAlive(i))
        {
            if(gf_TotalAng[i] >= MaxAngelChange)
            {
                if(g_Detections[i] >= MAX_DETECTIONS)
                {
                    RegisterOffense(i);
                }
                g_Detections[i]++;
            }
            else
                g_Detections[i] = 0;

            gf_TotalAng[i] = 0.0;
        }
    }
}

public Action:FakePrethink(Handle:timer)
{
    for(new i = 1; i<= g_iMaxClients; i++)
    {
        if(IsPlayerAlive(i))
        {
            decl Float:Angle[3];
            GetClientAbsAngles(i,Angle);
                  gf_TotalAng[i] += GetVectorDistance(gf_LastAng[i],Angle);
            CopyVector(Angle,gf_LastAng[i])

            new button = GetClientButtons(i);

            if(button & PLAYER_LEFT || button & PLAYER_RIGHT)
            {
                g_Detections[i] = 0;
            }
        }
    }
}

stock RegisterOffense(client)
{
    BanClient(client,0,BANFLAG_IP,"SpinHack Detected !","SpinHack Detected",_);
}

stock CopyVector(Float:Vec1[3],Float:Vec2[3])
{
    Vec2[0] = Vec1[0];
    Vec2[1] = Vec1[1];
    Vec2[2] = Vec1[2];
}

Last edited by blue zebra; 08-18-2010 at 03:54.
blue zebra is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 08-18-2010 , 11:53   Re: Keys are disabled in the game. Is is possible?
Reply With Quote #2

You can only detect predefined buttons:

http://docs.sourcemod.net/api/index....d=show&id=820&
http://docs.sourcemod.net/api/index....ad=file&id=47&
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
dYZER
Member
Join Date: Jan 2010
Location: Germany
Old 08-19-2010 , 12:27   Re: Keys are disabled in the game. Is is possible?
Reply With Quote #3

Quote:
Originally Posted by blue zebra View Post
For example: INS and DEL keys. (hotkeys for some cheats menu).
inpossible, to hook a 3rd plugin/(cheathook.exe)

u can check the key hits, (yes, but how often use u the DEL-key in chat, dont 4got the key layouts from different öäü)

but if u get a working key-disable func at dedicate server side, let me know
(i was working on1, no chance and give up...at reloading...)
dYZER is offline
blue zebra
BANNED
Join Date: Jun 2010
Old 08-22-2010 , 08:31   Re: Keys are disabled in the game. Is is possible?
Reply With Quote #4

Thanks.
If the key disable is not possible, that is not a big problem. And detect that keys? That is possible?
Br.
blue zebra is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 08-22-2010 , 16:25   Re: Keys are disabled in the game. Is is possible?
Reply With Quote #5

It is not possible to get the virtual key codes server-side as they are never transmitted via network. Only game defined keys are transmitted though they are independent from actual keyboard keys. You can detect and block any of them via OnPlayerRunCmd, see sticky post.
FaTony is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 08-22-2010 , 16:41   Re: Keys are disabled in the game. Is is possible?
Reply With Quote #6

Really doesnt prove anything anyways. Just cause they hit those buttons doesnt mean its a "hack" they are using... I use INS/DEL for switching classes and teams....

That is a very poor way to try and detect one specific hack....
__________________

Last edited by retsam; 08-22-2010 at 16:44.
retsam is offline
blue zebra
BANNED
Join Date: Jun 2010
Old 08-25-2010 , 06:59   Re: Keys are disabled in the game. Is is possible?
Reply With Quote #7

Poor way? Maybe. But i try to do something and not only see the cheater losers on my servers, like others. Thanks for the nothing.
Br.
blue zebra is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 08-25-2010 , 08:45   Re: Keys are disabled in the game. Is is possible?
Reply With Quote #8

He means that you really shouldn't rely on key presses and block hacking consequences.
FaTony 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 07:17.


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