Anti-Cheat command.
#2

Try this,
Код:
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
	{
		ohp = GetPlayerHealth(userid);
		oar = GetPlayerArmour(userid);
		GetPlayerPos(userid, x, y, z);
		CreateExplosion(x, y, z, 7, 10.0);
		nhp = GetPlayerHealth(userid);
		nar = GetPlayerArmour(userid);
		CreateExplosion(x, y ,z , 10, 10.0);
		SCM(playerid,0xFF4D4DFF,"{FF4D4D}[ANTI-CHEAT]: {DED9D9}Explosion created, wait for results!");
		if(ohp != nhp && oar != nar) return SCM(playerid,-1,"{FF4D4D}[ANTI-CHEAT] {DED9D9}RESULTS: 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,-1,"{FF4D4D}[ANTI-CHEAT]: Player is having HH!"), SCM(userid,COLOR_ERROR,"[ANTI-CHEAT]: You've been kicked from the server! Reason: Using HealthHack");
	}
	return 1;
}
Reply


Messages In This Thread
Anti-Cheat command. - by Fabyx15 - 10.07.2018, 17:40
Re: Anti-Cheat command. - by PgMNA - 10.07.2018, 18:18
Re: Anti-Cheat command. - by Fabyx15 - 10.07.2018, 18:39
Re: Anti-Cheat command. - by Fabyx15 - 10.07.2018, 19:07
Re: Anti-Cheat command. - by CodeStyle175 - 10.07.2018, 19:09
Re: Anti-Cheat command. - by Fabyx15 - 11.07.2018, 10:27

Forum Jump:


Users browsing this thread: 1 Guest(s)