SA-MP Forums Archive
anti cheat health and armour - pls help - 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)
+--- Thread: anti cheat health and armour - pls help (/showthread.php?tid=512513)



anti cheat health and armour - pls help - Miladajir - 11.05.2014

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


Re: anti cheat health and armour - pls help - Xtreme Brotherz - 11.05.2014

Sorry

No understand :P


Re: anti cheat health and armour - pls help - Miladajir - 11.05.2014

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


Re: anti cheat health and armour - pls help - Miladajir - 11.05.2014





--------------------
How to repeat the problem resolved?


Re: anti cheat health and armour - pls help - Beckett - 11.05.2014

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;
}