19.06.2016, 09:34
So guys I made an anti health hack system and it doesn't work for some reason.
When i connect to my server I don't get my old stats from database and every command is unknown O.O
Here is the code:
Can somebody help me? Thx
When i connect to my server I don't get my old stats from database and every command is unknown O.O
Here is the code:
Код:
new Float:newhealth[MAX_PLAYERS]; new Float:oldhealth[MAX_PLAYERS]; forward SetPlayerHealthEx(playerid, Float:hp); forward BKACHealth(); //OnGameModeInit SetTimer("BKACHealth", 1000, true); public SetPlayerHealthEx(playerid, Float:hp) { new Float:health; oldhealth[playerid] = GetPlayerHealth(playerid, health); SetPlayerHealthEx(playerid, hp); newhealth[playerid] = hp; return 1; } public BKACHealth() { new Float:hp, msg[128]; for(new i=0;i<MAX_PLAYERS;i++) { GetPlayerHealth(i, hp); if(hp > newhealth[i]) { if(pInfo[i][pLogged] == 1 && ocitan[i] == 1) { KickWithMessage(i, COLOR_INFO, "Kikovani ste sa servera!Razlog:Money hack."); format(msg, sizeof(msg), "BK|AC:Igrac %s je kikovan sa servera! Razlog:Health Hack.", GetName(i)); SCMALL(COLOR_INFO, msg); } } } return 1; }