Anti Health Hack.
#1

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

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

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

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

+1 Reputation.
Tnx

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)