Anti-Weapon Hack
#1

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?
Reply
#2

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);
}
Reply
#3

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

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..
Reply
#5

EDIT: This ^
Reply
#6

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.
Reply
#7

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.
Reply
#8

bump
Reply
#9

anti cheat tips - you will find everything you need to create anti cheat
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)