SA-MP Forums Archive
Anti-Weapon Hack - 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: Anti-Weapon Hack (/showthread.php?tid=504388)



Anti-Weapon Hack - JaKe Elite - 04.04.2014

I've already done a Anti-Money Hack, Anti-Health Hack and Anti-Armour Hack and it works good.

How about Anti-Weapon Hack, How do you make it?

Any example codes?


Re: Anti-Weapon Hack - Extraordinariness - 04.04.2014

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE))
    {
        switch(GetPlayerWeapon(playerid))
        {
            case 1..15:
            {
            new name1[MAX_PLAYER_NAME], string[128];
            GetPlayerName(playerid, name1, sizeof(name1));
            format(string, sizeof(string), "[ANTI-HAX]: %s [%d] has been banned from weapon hacking!", name1, playerid);
            SendClientMessageToAll(0xFF0000FF, string);
            SetTimerEx("BanPublic", 1000, false, "d", playerid); // get the kickpublic function
            }
        }
    }
    return 1;
}
Ban Public(from kickpublic)
pawn Код:
forward BanPublic(playerid);
public BanPublic(playerid)
{
    Ban(playerid);
}



Re: Anti-Weapon Hack - JaKe Elite - 04.04.2014

That is a simple anti-weapon hack it could ban innocent players who are RPing with their weapons.


Re: Anti-Weapon Hack - LocMax - 04.04.2014

It's hard to make anti-weapon hack, specially because it has ammo which lowers every time you shoot.
You'd need to somehow sync the weapon and ammo seperately, lower ammo OnPlayerWeaponShot, but then again if ammo reaches 0 you'd have to reset that weapon..


Re: Anti-Weapon Hack - Extraordinariness - 04.04.2014

EDIT: This ^


Re: Anti-Weapon Hack - JaKe Elite - 04.04.2014

Quote:
Originally Posted by Extraordinariness
Посмотреть сообщение
EDIT: This ^
Код:
case 1..15:
You were getting the Weapon ID ranging from 1 to 15.
Most of weapons on that weaponID are used in RPs - And you are banning them if they used it?

Quote:
Originally Posted by LocMax
Посмотреть сообщение
It's hard to make anti-weapon hack, specially because it has ammo which lowers every time you shoot.
You'd need to somehow sync the weapon and ammo seperately, lower ammo OnPlayerWeaponShot, but then again if ammo reaches 0 you'd have to reset that weapon..
This idea - This is the thing i am looking for, All i just need is an example so i could start my own one.


Re: Anti-Weapon Hack - Extraordinariness - 04.04.2014

Quote:
Originally Posted by _Jake_
Посмотреть сообщение
Код:
case 1..15:
You were getting the Weapon ID ranging from 1 to 15.
Most of weapons on that weaponID are used in RPs - And you are banning them if they used it?



This idea - This is the thing i am looking for, All i just need is an example so i could start my own one.
I then realized I was a failure and I dont want to edit again my post lol.


Re: Anti-Weapon Hack - JaKe Elite - 04.04.2014

bump


Re: Anti-Weapon Hack - doreto - 04.04.2014

anti cheat tips - you will find everything you need to create anti cheat


Re: Anti-Weapon Hack - ChuckyBabe - 04.04.2014

TIP :

s0b3it is using this code


GivePlayerWeapon

and in horizon roleplay

they use this code

GivePlayerValidWeapon
so that if anyone use a weapon cheat they will be auto-banned

+rep if i help