11.07.2018, 10:57
I made an anti-cheat, but when i explode someone and the damage is taken, ac is saying that player is hacking..
Код:
CMD:achh(playerid, params[]) { new userid, Float:x, Float:y, Float:z, Float:ohp, Float:oar, Float:nhp, Float:nar; if(PlayerInfo[playerid][pAdmin] < 2) return SCM(playerid,COLOR_ERROR,"Error: You must be admin level 2!"); if(sscanf(params, "u", userid)) return SCM(playerid,COLOR_GREY,"Usage: /achh [UserID]"); else if(userid == INVALID_PLAYER_ID) return SCM(playerid,COLOR_ERROR,"Error: Player is not connected!"); else if(userid == playerid) return SCM(playerid,COLOR_ERROR,"Error: You cannot use this command on yourself!"); else { GetPlayerHealth(userid, ohp); GetPlayerArmour(userid, oar); GetPlayerPos(userid, x, y, z); CreateExplosion(x, y, z, 7, 10.0); SCM(playerid,0xFF4D4DFF,"{FF4D4D}[ANTI-CHEAT]: {DED9D9}Explosion created, wait for results!"); GetPlayerHealth(userid, nhp); GetPlayerArmour(userid, nar); if(ohp != nhp && oar != nar) return SCM(playerid,0xFF4D4DFF,"{FF4D4D}[ANTI-CHEAT] {DED9D9}RESULTS: {5AE66F}Player is not having HH!"), SCM(userid,-1,"{FF4D4D}[ANTI-CHEAT]: {DED9D9}You've been exploded due Hack Acusations!"); if(ohp == nhp && oar == nar) return SCM(playerid,0xFF4D4DFF,"{FF4D4D}[ANTI-CHEAT] {DED9D9}RESULTS: {E65A5A}Player is having HH!"), SCM(userid,COLOR_ERROR,"{FF4D4D}[ANTI-CHEAT]: You've been kicked from the server! Reason: Using HealthHack"); } return 1; }