SA-MP Forums Archive
Where can I find hack detect script? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Where can I find hack detect script? (/showthread.php?tid=448842)



Where can I find hack detect script? - Passout - 06.07.2013

No I'm not looking for an "anti-cheat" script. I'm looking for the script that is able to detect if a player has hacks installed. It was released here sometime ago but I can't seem to find it. Also some servers are still using this so I know it can be found or created somehow...


Re: Where can I find hack detect script? - SuperViper - 06.07.2013

OnPlayerSpawn:

pawn Код:
new Float: frontCameraVectors[3];
GetPlayerCameraFrontVector(playerid, frontCameraVectors[0], frontCameraVectors[1], frontCameraVectors[2]);

if(frontCameraVectors[2] < -0.8)
{
    // Hacks installed
}
This is a piece of code I took from my new anticheat which will be released soon. I saw the code in a filterscript before it was deleted and I know a friend who used it on a popular roleplay server and it seems to work fine.


Re: Where can I find hack detect script? - SwisherSweet - 06.07.2013

im curious what exactly does that code detect?(not rude just asking) because im looking for an anti cheat aswell and i want to know will that be good for a straight up tdm server?


Re: Where can I find hack detect script? - SwisherSweet - 06.07.2013

lol gamer_z funniest pick ever, but true i tested aswell and if player looks there be she is hacking wtf


Re: Where can I find hack detect script? - SuperViper - 06.07.2013

I saw it in some filterscript released a while ago and apparently now my friend says it doesn't really work.


Re: Where can I find hack detect script? - exclide1 - 06.07.2013

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
OnPlayerSpawn:

pawn Код:
new Float: frontCameraVectors[3];
GetPlayerCameraFrontVector(playerid, frontCameraVectors[0], frontCameraVectors[1], frontCameraVectors[2]);

if(frontCameraVectors[2] < -0.8)
{
    // Hacks installed
}
This is a piece of code I took from my new anticheat which will be released soon. I saw the code in a filterscript before it was deleted and I know a friend who used it on a popular roleplay server and it seems to work fine.
I actually saw something like this on Mini-missions server. I was testing popular servers AC's, joined Mini-missions with n0beit, spawned, then my camera moved down and I got banned with the message "Cheat program detected". Pretty neat, lol.

Here you go. I just tested it out to make sure if wasn't an accident: http://imageshack.us/a/img824/3666/lxy.png

I wonder how they do that?

I found this:
pawn Код:
#include <a_samp>
#include <zcmd>

#pragma tabsize 0

#define PUB:%1(%2) forward %1(%2); public %1(%2)

#define FREEZE_SECONDS 4

#define red                     0xE60000FF

enum pinfo {
    firstspawn,
    pname[MAX_PLAYER_NAME],
    hacker
};
new gpInfo[MAX_PLAYERS][pinfo];

public OnPlayerConnect(playerid) {
    gpInfo[playerid][hacker] = 0;
    gpInfo[playerid][firstspawn] = 1;
    GetPlayerName(playerid, gpInfo[playerid][pname], MAX_PLAYER_NAME);
    return 1;
}

public OnPlayerSpawn(playerid) {
    if(gpInfo[playerid][firstspawn] == 1) {
        gpInfo[playerid][firstspawn] = 0;
        SetCameraBehindPlayer(playerid);
        TogglePlayerControllable(playerid, 0);
        SetTimerEx("HackCheck", FREEZE_SECONDS * 1000, 0, "i", playerid);
    }
    return 1;
}

PUB:HackCheck(playerid) {
    new Float:x, Float:y, Float:z;
    GetPlayerCameraFrontVector(playerid, x, y, z);
    #pragma unused x
    #pragma unused y
    if(z < -0.8) {
        TogglePlayerControllable(playerid, 1);
        gpInfo[playerid][hacker] = 1;
        new string[128];
        format(string, sizeof string, "[ANTICHEAT]: %s has connected with ****.", gpInfo[playerid][pname]);
        format(string, sizeof(string), "{ffffff}%s adlı oyuncu hileli olduğu iзin banlandı.", gpInfo[playerid][pname]);
SendClientMessageToAll(0x00FFFFFFAA, string);
                format(string, sizeof(string), "{F5FF00}-[Sebep]:   {FFFFFF}Hile tespit edildi.");
                SendClientMessage(playerid, red, string);
        Ban(playerid);
        for(new i=0; i<MAX_PLAYERS; ++i) if(IsPlayerAdmin(i)) SendClientMessage(i, 0xFF0000FF, string);
    }
    else {
        TogglePlayerControllable(playerid, 1);
    }
    return 1;
}

CMD:hackers(playerid, params[]) {
    if(!IsPlayerAdmin(playerid)) return 0;
    SendClientMessage(playerid, -1, "Hileli Oyuncular:");
    new string[128];
    for(new i=0; i<MAX_PLAYERS;++i) {
        if(gpInfo[i][hacker] == 1) {
            format(string, sizeof string, "%s[%d]", gpInfo[i][pname], i);
            SendClientMessage(playerid, -1, string);
        }
    }
    return 1;
}
Will check it and report results.


Re: Where can I find hack detect script? - exclide1 - 06.07.2013

AAAAAND, it works, lol! I wonder how.

P.S. I noticed that, if I join server with n0beit, it moves my camera down on spawn, when I'm freezed. When it's over, I'm banned. If I join with no hacks, it doesn't move the camera.

Код:
reputation -3
Yeah-yeah, thanks, exclide, for posting this code, that will help me get rid of cheaters on my server! No problem.

Quote:

Posting stuff like this publically improves cheat programs. ~[MM]IKKE

Sure. Posting it publically. It's not like I found it in ******.

Just "-4"? Give me more negative rep, so I'd never think of contributing to this section again.


Re: Where can I find hack detect script? - Passout - 07.07.2013

Quote:
Originally Posted by exclide1
Посмотреть сообщение
AAAAAND, it works, lol! I wonder how.

P.S. I noticed that, if I join server with n0beit, it moves my camera down on spawn, when I'm freezed. When it's over, I'm banned. If I join with no hacks, it doesn't move the camera.

Код:
reputation -3
Yeah-yeah, thanks, exclide, for posting this code, that will help me get rid of cheaters on my server! No problem.


Sure. Posting it publically. It's not like I found it in ******.

Just "-4"? Give me more negative rep, so I'd never think of contributing to this section again.
It doesn't work and I don't see how it would.


Re: Where can I find hack detect script? - Alternative112 - 07.07.2013

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
OnPlayerSpawn:

pawn Код:
new Float: frontCameraVectors[3];
GetPlayerCameraFrontVector(playerid, frontCameraVectors[0], frontCameraVectors[1], frontCameraVectors[2]);

if(frontCameraVectors[2] < -0.8)
{
    // Hacks installed
}
This is a piece of code I took from my new anticheat which will be released soon. I saw the code in a filterscript before it was deleted and I know a friend who used it on a popular roleplay server and it seems to work fine.
I tried doing this and it hasn't worked at all so far. Every time I spawn, frontCameraVectors[2] is always -0.0, both when I do and do not have n00biet installed and activated. sometimes I also get garbled input for frontCameraVectors[0] when I try to printf it with %.1f, too. Normal gameplay and F4 + kill always result in frontCameraVectors[2] being -0.0.

HOWEVER, I think using GetPlayerCameraFrontVector with finding what direction a player is facing could be used to detect if a player is using joypad or mouse + keys configuration.