15.01.2014, 15:09
Hello,
I've been trying to create my own simple anti health hack using the wiki and some tutorials. All it should be doing is check whether or not the player's HP is above a certain level. However in-game nothing really happens when I set my own HP to several different values above the limit.
The first bit is a custom health bar which was in the script by default, that might have something to do with it though. My scripting is the second bit.
Entire OnPlayerUpdate: http://pastebin.com/GgPAvRPk
I have tried putting the code outside of the if(PlayerStatus[playerid][dead] == false), but the chat would just get spammed with false warnings from people not yet spawned.
Any help would be greatly appreciated, this looks like a simple problem to me, however I've asked multiple people and none of them knew the error.
I've been trying to create my own simple anti health hack using the wiki and some tutorials. All it should be doing is check whether or not the player's HP is above a certain level. However in-game nothing really happens when I set my own HP to several different values above the limit.
Код:
if(PlayerStatus[playerid][dead] == false) { //Health new Float:HP, string[24]; GetPlayerHealth(playerid, HP); new dots = floatround(floatdiv(HP, 0.8695652173913044), floatround_round); for(new i; i < dots; i++) { string[i] = 'l'; } TextDrawSetString(PlayerStatus[playerid][Health], string); // My bit new Float:hp; GetPlayerHealth(playerid, hp); if(hp >= 52.0) { SendClientMessageToAll(-1, "[DEBUG] Health Hacks Detected"); }
Entire OnPlayerUpdate: http://pastebin.com/GgPAvRPk
I have tried putting the code outside of the if(PlayerStatus[playerid][dead] == false), but the chat would just get spammed with false warnings from people not yet spawned.
Any help would be greatly appreciated, this looks like a simple problem to me, however I've asked multiple people and none of them knew the error.