Anti Health/Armour Hack.
#1

Hello everyone,
I started to make an AntiCheat for my gamemode,
The AntiCheat works fine, but when players shoot player, or player jump from an hige place, the script see it like an cheat.

I think to use OnPlayerGiveDamage (tell me if it incorrect)
I dont understand how to check if the amount of damage is Health or an Armour, And how to do it.

my functions is:
Код:
CDM_SetPlayerHealth(playerid, Float:health);
CDM_SetPlayerArmour(playerid, Float:armour);
HELP & Sry about my English.

edit:

I did something like:
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
	new Float:p[2];
	GetPlayerHealth(damagedid, p[0]);
	GetPlayerArmour(damagedid, p[1]);
	if(p[1] != 0) CDM_SetPlayerArmour(damagedid, p[1]-amount);
	else if(!p[1]) CDM_SetPlayerHealth(damagedid, p[0]-amount);
    return 1;
}
But it's isn't work.
Reply
#2

UP..
Reply
#3

UP..
Reply
#4

Can you show us the anticheat code, For example, The code to detect wether or not the player is hacking?
Reply
#5

Quote:
Originally Posted by jueix
Посмотреть сообщение
Can you show us the anticheat code, For example, The code to detect wether or not the player is hacking?
OnPlayerUpdate:
Код:
		new Float:health, Float:armour;
		GetPlayerHealth(playerid, health);
		GetPlayerArmour(playerid, armour);
		if(health != GetPVarFloat(playerid, "Health"))
		{
			SetPlayerHealth(playerid, GetPVarFloat(playerid, "Health"));
		}
		if(armour != GetPVarFloat(playerid, "Armour"))
		{
			SetPlayerArmour(playerid, GetPVarFloat(playerid, "Armour"));
		}
Function:
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
	new Float:p[2];
	CDM_GetPlayerHealth(issuerid, p[0]);
	CDM_GetPlayerArmour(issuerid, p[1]);
	if(p[1] != 0) CDM_SetPlayerArmour(issuerid, p[1]-amount);
	else if(!p[1]) CDM_SetPlayerHealth(issuerid, p[0]-amount);

	if(amount != 0 && p[0] == 100.0)
	{
		for(new i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && player[i][adminlevel] != 0)
		{
		    message[0] = EOS;
			SendFormatMessageToAll(color_red, message, "(AC) {FFFFFF}%s {FF0000}has using hacks (reason: Godmode Hack)", getname[issuerid]);
		}
	}
    return 1;
}
I dont think that's the right public.
HELP.
Reply
#6

-_- UP PLEASE!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)