[Tutorial] Creating Simple Anti Health/Armour Hacks
#1

Hello everyone , this is my Tuorial about how to create a simple Anti Health / Armour hack , iam newbie at scripting but iam sure this is working as i tested it

Now Follow me :

- First of All , when they players Spawn use This

pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerArmour(playerid, 95);
    SetPlayerHealth(playerid, 95);
    return 1;
}
// Now you have set Max. HP(Health Points) and AP(Armour Points) when the player spawns.
Everything should go clean without any Bugs or errors if you got a working a_samp include.
Now we will use OnPlayerUpdate in 2 small functions

pawn Code:
public OnPlayerUpdate(playerid)
{
    new Float:pHealth;
    GetPlayerHealth(playerid, pHealth);
    if(pHealth >= 96)
    {
    SendClientMessage(playerid, -1, "{FF0000} You Got Banned for Health Hacking [ HP Exceeded 95 ]");
    Ban(playerid);
    }

    new Float:pArmour;
    GetPlayerArmour(playerid, pArmour);
    if(pArmour >= 96)
    {
    SendClientMessage(playerid, -1, "{FF0000} You Got Banned for Armour Hacking [ AP Exceeded 95 ]);
    Ban(playerid);
    }

    return 1;
}

// Now if the player's armour/health increases and become equal or more than 96 , The player gets Auto Banned
You are Done , Next Part i will tell you how to add Exception for simple Resturant.

Result

pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerArmour(playerid, 95);
    SetPlayerHealth(playerid, 95);
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new Float:pHealth;
    GetPlayerHealth(playerid, pHealth);
    if(pHealth >= 96)
    {
    SendClientMessage(playerid, -1, "{FF0000} You Got Banned for Health Hacking [ HP Exceeded 95 ]");
    Ban(playerid);
    }
    new Float:pArmour;
    GetPlayerArmour(playerid, pArmour);
    if(pArmour >= 96)
    {
    SendClientMessage(playerid, -1, "{FF0000} You Got Banned for Armour Hacking [ AP Exceeded 95 ]);
    Ban(playerid);
    }
    return 1;
}
P.S : idk if someone made this or not already but i made all of this by myself , thanks for reading
Reply
#2

Hmm, simple and nice tutorial.But what will happen if an admin give you 100 health and 100 armour?Try to set immune for a player which health/armour is given by admin.
Reply
#3

Quote:
Originally Posted by Smokkr
View Post
But what will happen if an admin give you 100 health and 100 armour?
or if players use Vending Machines
Reply
#4

Quote:
Originally Posted by Smokkr
View Post
Hmm, simple and nice tutorial.But what will happen if an admin give you 100 health and 100 armour?Try to set immune for a player which health/armour is given by admin.
well you have to set your Max. Healh in /sethealth to 95 not any more to avoid that.
also to the armour.
everything could be done via the script.
and i can add simple Exception incase player is admin.
Reply
#5

You should take a look at this one: https://sampforum.blast.hk/showthread.php?tid=220089
Reply
#6

First time to read it.
Reply
#7

Quote:
Originally Posted by BigETI
View Post
You should take a look at this one: https://sampforum.blast.hk/showthread.php?tid=220089
THANK YOU@!!!!!!!!!!!!!!!!!!!!!!!
Reply
#8

It's much better to use timers for Anti-Cheat systems, much more efficient than OnPlayerUpdate. HOWEVER, yeah, it's a nice basic tutorial for beginners.
Reply
#9

really this is my first Tutorial and the scripts i made isn't very advanced.
thanks
Reply
#10

Great its work on my server Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)