SetPlayerHealth bug
#8

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
If you want to create some kind of admin invincibility, then I suggest you set the health of a player everytime they take the damage (OnPlayerTakeDamage(...) callback), alternatively OnPlayerUpdate to keep resetting them.

Specifically for anti-hack, I suggest you very much use OnPlayerUpdate and set their health (SetPlayerHealth) by having it saved down into a player enum everytime it changes.

Example of what I mean:
Код:
enum playerInfo{
     Float:pHealth
};
new pInfo[MAX_PLAYERS][playerInfo];

OnPlayerTakeDamage(...)
{
     GetPlayerHealth(playerid, pInfo[playerid][pHealth]);
     return 1;
}

OnPlayerUpdate(...)
{
     SetPlayerHealth(playerid, pInfo[playerid][pHealth]);
     return 1;
}
That way the health is considered somewhat server-sided and not client-sided. If they would "cheat" to set their health, it would never save it down to pInfo[playerid][pHealth] and therefore their HP would still set to what was previously used. This is just an example however and there are more ways to do it!
I have a better solution
If you /sethp someone's HP to higher than 255, you get blocked and are being told to use /god.

/god is a command I just made further to this question, simply if(GodMode[hitid]) return 0; under OnPlayerWeaponShot

Thanks anyways for trying mate
My anti hack is quiet more powerful, if your HP (getplayerhealth) or armor != your HP / AP variable, Banned.
That's why it's so hard to make it, to prevent ANY unnecessary bans
Reply


Messages In This Thread
SetPlayerHealth bug - by NeXoR - 03.11.2016, 15:16
Re: SetPlayerHealth bug - by NeXoR - 03.11.2016, 15:19
Re: SetPlayerHealth bug - by GoldenLion - 03.11.2016, 16:30
Re: SetPlayerHealth bug - by Hansrutger - 03.11.2016, 16:33
Re: SetPlayerHealth bug - by DomagojSellug - 03.11.2016, 16:37
Re: SetPlayerHealth bug - by NeXoR - 03.11.2016, 18:54
Re: SetPlayerHealth bug - by Hansrutger - 03.11.2016, 20:22
Re: SetPlayerHealth bug - by NeXoR - 03.11.2016, 20:32

Forum Jump:


Users browsing this thread: 2 Guest(s)