IsPlayerInRangeOfPoint/OnPlayerWeaponShot problem
#1

So, I've tried creating an Aimbot Detector for the "new famous aimbot of 0.3z".
At first it worked, but after 'heavier' usage it started to bug.
So i tried to fix it, then it didn't work etc..

After some time, Tamer T told me to use
pawn Код:
GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
Instead of the
pawn Код:
OnPlayerWeaponShot(...., Float:fX, Float:fY, Float:fZ)
That OnPlayerWeaponShot has.

It worked at first, but then after more usage/testing, it started to give out false/random alerts etc..
Code;
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    TimesShot[playerid]++;
    if(TimesShot[playerid] < 20)
    {
        if(hittype == BULLET_HIT_TYPE_PLAYER)
        {
            if(!IsAFK{ hitid })
            {
                if(!CoolDown[playerid])
                {
                    new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
                    GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
                    CheckForAimbot(playerid, fHitPosX, fHitPosY, fHitPosZ);
                }
            }
        }
    }
    return 1;
}

stock CheckForAimbot(playerid, Float:fX, Float:fY, Float:fZ)
{
    new string[118], Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
   
    if(!CoolDown[playerid])
    {
        if(!DetectedForAimbot{ playerid })
        {
            foreach(Player, i)
            {
                if(GetPlayerState(i) != PLAYER_STATE_SPECTATING)
                {
                    if(!IsPlayerInRangeOfPoint(i, 3.0, fX, fY, fZ))
                    {
                        TimesDetected[playerid]++;
                        if(TimesDetected[playerid] >= 3)
                        {
                            format(string, sizeof(string), "WARNING: %s(%d) is POSSIBLY using aimbot. /spec %d and /atest %d to test him.", GetName(playerid), playerid, playerid, playerid);
                            //SendClientMessageToAll(COLOR_NOTES2, string);
                            DetectedForAimbot{ playerid } = true;
                        }
                    }
                }
            }
            if(TimesDetected[playerid] >= 3)
            {
                SendClientMessageToAll(COLOR_NOTES2, string);
            }
        }
    }
    string = "\0";
}
I tried adding "else" under "if(!IsPlayer ......)", to reduce "TimesDetected" but then it didn't work at all.
Any ideas? :\

Video preview -
[ame]http://www.youtube.com/watch?v=22L6RUMBqf8[/ame]
Reply


Messages In This Thread
IsPlayerInRangeOfPoint/OnPlayerWeaponShot problem - by Kyance - 24.06.2014, 12:51
Re: IsPlayerInRangeOfPoint/OnPlayerWeaponShot problem - by Kyance - 25.06.2014, 05:27
Re: IsPlayerInRangeOfPoint/OnPlayerWeaponShot problem - by Threshold - 25.06.2014, 07:10
Re: IsPlayerInRangeOfPoint/OnPlayerWeaponShot problem - by Kyance - 25.06.2014, 12:59

Forum Jump:


Users browsing this thread: 1 Guest(s)