Anti Health Hack
#1

I failed on a Anti Health Hack here =/
This bans you when you Loose health.
Soo, How to fix

pawn Код:
#include <a_samp>
#include <foreach>

forward AntiHealthHack();
new Float:pHealth[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("AntiHealthHack", 1000, true);
    return 1;
}

public OnPlayerConnect(playerid)
{
    pHealth[playerid] = 100;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    pHealth[playerid] = 100;
    return 1;
}

public AntiHealthHack()
{
    foreach(Player, i)
    {
        new Float:Health;
        GetPlayerHealth(i, Health);
        if(Health != pHealth[i] && Health > 0)
        {
            if(Health < pHealth[i])
            {
                pHealth[i] = Health;
                BanEx(i, "Health Hacker");
            }
            else
            {
                SetPlayerHealth(i, pHealth[i]);
                return 1;
            }
        }
    }
    return 1;
}
Reply
#2

pawn Код:
BanEx(i, "Health Hacker");
wouldnt that ban all the players ?
Reply
#3

Quote:

Come Join my server:
IP: 127.0.0.1:7777

Lol?
Anyway, what your 'AntiHealthHack' does is it basically bans you every time your hp is not equal to 100 and is more than zero.
You have epicly failed.

Quote:
Originally Posted by marinov
Посмотреть сообщение
pawn Код:
BanEx(i, "Health Hacker");
wouldnt that ban all the players ?
ROFLMFAO.
Reply
#4

Quote:
Originally Posted by marinov
Посмотреть сообщение
pawn Код:
BanEx(i, "Health Hacker");
wouldnt that ban all the players ?
No?

Quote:
Originally Posted by maramizo
Посмотреть сообщение
Lol?
Anyway, what your 'AntiHealthHack' does is it basically bans you every time your hp is not equal to 100 and is more than zero.
You have epicly failed.



ROFLMFAO.
Yeah About my signature, it is named FUN, i have there is for fun and i get some messages from noobs "Why cant i connect to your server" and they are serious :]



AND "You have epicly failed."....... Why do you think im asking for HELP?
Reply
#5

Quote:
Originally Posted by Unknown123
Посмотреть сообщение
I failed on a Anti Health Hack here =/
This bans you when you Loose health.
Soo, How to fix

pawn Код:
#include <a_samp>
#include <foreach>

forward AntiHealthHack();
new Float:pHealth[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("AntiHealthHack", 1000, true);
    return 1;
}

public OnPlayerConnect(playerid)
{
    pHealth[playerid] = 100;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    pHealth[playerid] = 100;
    return 1;
}

public AntiHealthHack()
{
    foreach(Player, i)
    {
        new Float:Health;
        GetPlayerHealth(i, Health);
        if(Health != pHealth[i] && Health > 0)
        {
            if(Health < pHealth[i])
            {
                pHealth[i] = Health;
                BanEx(i, "Health Hacker");
            }
            else
            {
                SetPlayerHealth(i, pHealth[i]);
                return 1;
            }
        }
    }
    return 1;
}
pawn Код:
if(Health != pHealth[i] && Health > 0)
> greater then
< less then



Quote:
Originally Posted by maramizo
Посмотреть сообщение
Lol?
Anyway, what your 'AntiHealthHack' does is it basically bans you every time your hp is not equal to 100 and is more than zero.
You have epicly failed.



ROFLMFAO.
Who the fuck do u think u are u asshole ? We don't need another fagget like you to come here and annoy everyone, This part of the forums is for people who is having trouble, and people learning how to scrip, if u gonna laugh like an asshole for every mistake someone makes here YOU will be the stupid one.
Reply
#6

Quote:
Originally Posted by marinov
Посмотреть сообщение
pawn Код:
if(Health != pHealth[i] && Health > 0)
Who the fuck do u think u are u asshole ? We don't need another fagget like you to come here and annoy everyone, This part of the forums is for people who is having trouble, and people learning how to scrip, if u gonna laugh like an asshole for every mistake someone makes here YOU will be the stupid one.
I really love the report button, let's see if it works.
If you're so good at it then go ahead and fix his anti health hack before a mod sees this... Go go go!
Reply
#7

Quote:
Originally Posted by maramizo
Посмотреть сообщение
I really love the report button, let's see if it works.
If you're so good at it then go ahead and fix his anti health hack before a mod sees this... Go go go!
Ohh woow u gonna tell on me, grow up, I'm the only one here trying to help him, so stfu, now only reply if u wanna help that guy -.-
Reply
#8

Quote:
Originally Posted by marinov
Посмотреть сообщение
Ohh woow u gonna tell on me, grow up, I'm the only one here trying to help him, so stfu, now only reply if u wanna help that guy -.-
Dude you should start making some jokes.
Back @ unknown
Just make a command like /checkhh and what it does is CreateExplosion near the player, so that he doesn't die but his HP should decrease, you GetPlayerHealth(playerid) twice, one before explosion and one after.
If the player's HP is still the same, it bans him.
Otherwise it SetPlayerHealth to the first value gained.
Reply
#9

Quote:
Originally Posted by marinov
Посмотреть сообщение
Ohh woow u gonna tell on me, grow up, I'm the only one here trying to help him, so stfu, now only reply if u wanna help that guy -.-
I agree with marinvo, Hes just telling the truth and to the Moderators, i dont think marinvo deserver a ban cuz of telling the truth.


Back on topic now?

Any help?
Reply
#10

> greater then
< less then

pawn Код:
if(Health != pHealth[i] && Health > 0)
        {
            if(Health < pHealth[i])
            {
pawn Код:
if(Health != pHealth[i] && Health > 0)
        {
            if(Health > pHealth[i]) //here id was < (that would ban if health was less then 100)
            {
I hope thats what u wanted it to do lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)