How to create /aimtest ?
#1

Hello,

I want to create a command that show if someone is using aimbot or no. I think a lot of scripters know how to make it, and what is it's job. Which is to teleport the one that is aimed on to a place near the player aiming. Can anyone give me the codes plz.
+REP will be given
Reply
#2

Aimbots are scriptly undetectable, unless you're using a 360 aimbot which will obviously cause the player to spin around while firing.

My suggestion is to just spec them, and if they hit every shot and their target was running in circles then it's pretty clear.
Reply
#3

pawn Код:
#include <a_samp>

#define DEBUG 0
#include zcmd
#include sscanf2
#pragma tabsize 0
new bool:autoaim[MAX_PLAYERS]                = {false, ...};
new checkautoaim[MAX_PLAYERS]                = {9999, ...};
new pressingaimtick[MAX_PLAYERS]             = {-1, ...};
new bool:keyfire[MAX_PLAYERS]                = {false, ...};
new bool:ispressingaimkey[MAX_PLAYERS]       = {false, ...};
new bool:CheckNextAim[MAX_PLAYERS]           = {false, ...};

public OnFilterScriptInit() {
        for(new i=0; i < MAX_PLAYERS; ++i) {
            if(IsPlayerConnected(i)) {
                OnPlayerConnect(i);
                }
        }
        return 1;
}

public OnPlayerConnect(playerid) {
        checkautoaim[playerid]     = 9999;
        pressingaimtick[playerid]  = -1;
        autoaim[playerid]                  = false;
        keyfire[playerid]          = false;
        ispressingaimkey[playerid] = false;
        CheckNextAim[playerid]     = false;

        return 1;
}

public OnPlayerUpdate(playerid) {
        new var = GetPlayerTargetPlayer(playerid);
        if(var != INVALID_PLAYER_ID) {
            CheckNextAim[playerid] = true;
        }
        #if DEBUG == 1
        new str[129];
    format(str, sizeof(str), "%d", GetPlayerTargetPlayer(playerid));
    SendClientMessage(playerid, -1, str);
    #endif
    if(checkautoaim[playerid] <= 10) {
        if(var != INVALID_PLAYER_ID) {
            checkautoaim[playerid] = 9999;
        }
        checkautoaim[playerid]++;
        if(checkautoaim[playerid] == 11)
        {

            #if DEBUG == 1
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pname, sizeof(pname));
            format(str, sizeof(str), "*** Aimbot warning user - %s ***", pname);
            SendClientMessageToAdmins(-1, str);
            #endif
            autoaim[playerid] = true;

                        CallRemoteFunction("OnPlayerDetectedAutoaim", "d", playerid);
        }
    }
    return 1;
}
stock PlayerName(playerid)
            {
            new pName[25];
            GetPlayerName(playerid, pName, sizeof(pName));
            return pName;
            }
stock SendClientMessageToAdmins(color, const message[])
{
        new msgstring[256];
        for(new i; i < MAX_PLAYERS; i++)
        {
                if(adminlevel[i] == 0) //Change your Admin Variable Here
                {
                        return 0;
                }
                else
                {
                        SendClientMessage(i, color, msgstring);
                        print("AdmCmd");
                }
        }
        return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) {

        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(damagedid, X, Y, Z);
        new str[128];
        format(str, sizeof(str), "%d == false %d < %d && %d != -1 && %d == 53 && %d == %d && %d == 1 && %d && %d == false", CheckNextAim[playerid], pressingaimtick[playerid], GetTickCount(), pressingaimtick[playerid], GetPlayerCameraMode(playerid), GetPlayerTargetPlayer(playerid), INVALID_PLAYER_ID, IsPlayerInRangeOfPoint(playerid, 50, X, Y, Z), notallowed(weaponid), keyfire[playerid]);
        #if DEBUG == 1
        SendClientMessage(playerid, -1, str);
        #endif
        printf(" Autoaim Detection information: %s", str);
        if(CheckNextAim[playerid] == false && pressingaimtick[playerid] < GetTickCount() && pressingaimtick[playerid] != -1 && GetPlayerCameraMode(playerid) == 53 && GetPlayerTargetPlayer(playerid) == INVALID_PLAYER_ID && IsPlayerInRangeOfPoint(playerid, 50, X, Y, Z) == 1 && notallowed(weaponid) && keyfire[playerid] == false && !IsPlayerInAnyVehicle(damagedid)) {
            checkautoaim[playerid] = 0;
        }
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if(!(oldkeys & KEY_FIRE) && (newkeys & KEY_FIRE) && !(newkeys & KEY_HANDBRAKE)) {
            keyfire[playerid] = true;
        } else if(!(newkeys & KEY_FIRE)) keyfire[playerid] = false;
        if(!ispressingaimkey[playerid]) CheckNextAim[playerid] = false;
        ispressingaimkey[playerid] = !!(newkeys & KEY_HANDBRAKE);
        if(ispressingaimkey[playerid] && !(oldkeys & KEY_HANDBRAKE)) {
            pressingaimtick[playerid] = GetTickCount()+500;
        }
        return 1;
}


stock notallowed(weaponid) {
        switch(weaponid) {

                case 25..27, 16..18, 34..37, 39..40, 43..200: return 0;
                // Blocks shotguns, sniper rifle, RPG, heat seaker satchel charges etc - besides shotguns these are unaffected by autoaim
                // the reason shotguns are removed from checking is because i've found them to be unreliable.
                default:return 1;
        }
        return 1;
}


stock IsPlayerUsingAutoaim(playerid) return autoaim[playerid];
Here bra, made some changes just change your variables and everything shall be working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)