SA-MP Forums Archive
Anti Health 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti Health Hack. (/showthread.php?tid=272736)



Anti Health Hack. - Alex_Obando - 29.07.2011

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

forward Hacking();

public OnPlayerUpdate(playerid)
{
    new Float:fHealth;

    GetPlayerHealth(playerid, fHealth);

    if(fHealth != GetPVarFloat(playerid, "faPlayerHealth"))
    {
        // Player health has changed since the last update -> server, so obviously thats the thing updated.
        // Lets do further checks see if he's lost or gained health, anti-health cheat? ;)

        if(fHealth > GetPVarFloat(playerid, "faPlayerHealth"))
        {
             SetTimer("Hacking", 2000, false);
             SendClientMessageToAll(0xDEEE20FF, "TEST");
        }
        else
        {
            /* He has lost health! */
        }

        SetPVarFloat(playerid, "faPlayerHealth", fHealth);
    }
}
I have that but when the player spawn it sends the message, its really annoying, How to fix it?
If you wanna join me read my signature.


Re: Anti Health Hack. - Snipa - 29.07.2011

pawn Код:
if(GetPlayerState(playerid) == 1) {
//rest of code
If the player is on foot, do x.


Respuesta: Anti Health Hack. - Alex_Obando - 29.07.2011

C:\Users\Alex\Desktop\AntiHealthHacks.pwn(32) : error 030: compound statement not closed at the end of file (started at line 9)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: Anti Health Hack. - Mean - 29.07.2011

...
pawn Код:
if(GetPlayerState(playerid) == 1) {
    //rest of code
}// We closed the statement here...



Respuesta: Anti Health Hack. - Alex_Obando - 29.07.2011

+1 Reputation.
Tnx

Edit: Still getting the messages when player connect / Spawn D:


Re: Anti Health Hack. - Mean - 29.07.2011

You can try something like this:
pawn Код:
new spawned[ MAX_PLAYERS ];

public OnPlayerConnect( playerid )  {
    spawned[ playerid ] = 0;
    return 1;
}

public OnPlayerRequestClass( playerid, classid ) {
    spawned[ playerid ] = 0;
    return 1;
}

public OnPlayerSpawn( playerid ) {
    spawned[ playerid ] = 1;
    return 1;
}

public OnPlayerDeath( playerid, killerid, reason ) {
    spawned[ playerid ] = 0;
    return 1;
}
And now, use:
pawn Код:
if( spawned[ playerid ] == 1 ) {
    //rest of code
}



Re: Anti Health Hack. - MadeMan - 29.07.2011

pawn Код:
SendClientMessageToAll(0xDEEE20FF, "TEST");
Just delete it.


Respuesta: Anti Health Hack. - Alex_Obando - 29.07.2011

Are you idiot?
Then if I delete it whats the point of the script?


Respuesta: Anti Health Hack. - Alex_Obando - 29.07.2011

It doesntsend those annoying messages, But when the player spawn it sends the message D:


Re: Respuesta: Anti Health Hack. - MadeMan - 30.07.2011

Quote:
Originally Posted by Alex_Obando
Посмотреть сообщение
Are you idiot?
No, but I think you are.