anti cheat health and armour - pls help
#1

hello
i have one problem.
When someone uses cheat Health.
Several times is killed.
I once killed.
Please help.
------------
Код:
public OnPlayerUpdate(playerid)
{
    new Float:pHealth;
    GetPlayerHealth(playerid, pHealth);
    if(pHealth >= 100)
    {
    new Namep[MAX_PLAYER_NAME], AntiCheatHealthMessage[128];
    GetPlayerName(playerid, Namep, sizeof(Namep));
    format(AntiCheatHealthMessage, sizeof(AntiCheatHealthMessage), "{FF0000}[AntiCheat] Player %s = hacked health", Namep, playerid);
    SendClientMessageToAll(0xFFFFFFFF, AntiCheatHealthMessage);
    SetPlayerHealth(playerid, 0);
	}
    new Float:pArmour;
    GetPlayerArmour(playerid, pArmour);
    if(pArmour >= 100)
    {
    new Namep[MAX_PLAYER_NAME], AntiCheatArmourMessage[128];
    GetPlayerName(playerid, Namep, sizeof(Namep));
    format(AntiCheatArmourMessage, sizeof(AntiCheatArmourMessage), "{FF0000}[AntiCheat] Player %s = hacked armour", Namep, playerid);
    SendClientMessageToAll(0xFFFFFFFF, AntiCheatArmourMessage);
    SetPlayerHealth(playerid, 0);
    }
    return 1;
}
Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerHealth(playerid, 99);
	return 1;
}
------------
sorry. my bad english
Reply
#2

Sorry

No understand :P
Reply
#3

uploading picture...
---------------
A Question.
Anti Cheat Vehicle Where to get?
thanks
Reply
#4





--------------------
How to repeat the problem resolved?
Reply
#5

Because when the player spawn he will spawn with 100 health therefore he will be killed EVERY UPDATE that is why.

Go to OnPlayerSpawn and do this.

pawn Код:
public OnPlayerSpawn(vehicleid)
{
    SetPlayerHealth(playerid,99);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)