[FilterScript] Anti-HealthHack & ArmourHack v1.0
#1

Hi there, I made this anti HealthHack&AntiArmourHack and it has been working great :]

However, if you got /god in your GM, I recommend you to adapt it.

Код:
//#define FILTERSCRIPT
//<Anti-HealthHack v1.0> by driftpower
#include <a_samp>
#define red 0xE60000FF
new Float:playerHealth[MAX_PLAYERS], Float:playerArmour[MAX_PLAYERS], shots[MAX_PLAYERS], pTimer[MAX_PLAYERS];
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Anti-HealthHack by driftpower");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
}

#endif

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
	if(weaponid != 0 && issuerid != INVALID_PLAYER_ID){ //add here if player has god(variable, not health) before you do the detection
	     shots[playerid]++;
		 if(shots[playerid] == 1){
		    GetPlayerHealth(playerid, playerHealth[playerid]);
		    GetPlayerArmour(playerid, playerArmour[playerid]);
		 	pTimer[playerid] = SetTimerEx("checkPlayer", 3000, false, "i", playerid);
		 	}
	     if(shots[playerid] == 2 || shots[playerid] < 6){
		    GetPlayerHealth(playerid, playerHealth[playerid]);
		    GetPlayerArmour(playerid, playerArmour[playerid]);
			pTimer[playerid] = SetTimerEx("checkPlayer", 6000, false, "i", playerid);
			}
	 }
	return 1;
}

forward checkPlayer(playerid);
public checkPlayer(playerid)
{
	if(shots[playerid] >= 2){
    new Float:pHealth, Float:pArmour;
	GetPlayerHealth(playerid, pHealth);
	GetPlayerArmour(playerid, pArmour);
	if(pArmour == playerArmour[playerid]){
	    new string[140], pName[MAX_PLAYER_NAME+1];
     	GetPlayerName(playerid, pName, sizeof(pName));
	    format(string, sizeof(string), "[{24FF0A}Anti-HH{E60000}] {24FF0A}%s{E60000}({24FF0A}%d{E60000}) {24FF0A}got pwned for using HealthHack!!", pName, playerid);
	    SendClientMessageToAll(red, string);
	    SetPlayerHealth(playerid, 0.0);
	    shots[playerid] = 0;
		//kick/ban here.
	}
	else if(pHealth == playerHealth[playerid] && pArmour == 0){
	    new string[140], pName[MAX_PLAYER_NAME+1];
     	GetPlayerName(playerid, pName, sizeof(pName));
	    format(string, sizeof(string), "[{24FF0A}Anti-HH{E60000}] {24FF0A}%s{E60000}({24FF0A}%d{E60000}) {24FF0A}got pwned for using HealthHack!!", pName, playerid);
	    SendClientMessageToAll(red, string);
	    SetPlayerHealth(playerid, 0.0);
	    shots[playerid] = 0;
		//kick/ban here.
	}
	}
	return 1;
}
public OnPlayerConnect(playerid)
{
	shots[playerid] = 0;
	return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
	shots[playerid] = 0;
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	shots[playerid] = 0;
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Pastebin: http://pastebin.com/GmxWLWXB

NOTE: Only tested on 0.3x-R2

But I think it will work as well on 0.3z, what this does is it sets a first timer to check the player's health and a second timer on the second/third/etc shot to see if the player still has the same Health/Armour.

Pretty simple system!
Reply
#2

works ?
Reply
#3

ofcourse it works :P
Nice work bro
Reply
#4

This won't work, if the player is lagging hard he will get banned. And it's not codded well, your setting a timer every time a player takes damage. What if a player shoots another player with M4? then the timer will be called a dozen of times then he will get banned also.

And do you know that OnPlayerTakeDamage doesn't get called if you have unlimited health hacks on?
Reply
#5

If you configure your server correctly health hacking is impossible skin hit system with server sided damage.
Reply
#6

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
This won't work, if the player is lagging hard he will get banned. And it's not codded well, your setting a timer every time a player takes damage. What if a player shoots another player with M4? then the timer will be called a dozen of times then he will get banned also.

And do you know that OnPlayerTakeDamage doesn't get called if you have unlimited health hacks on?
I actually tested with minigun(which calls the event more than 10 times per second) and it only runs the timer twice in some cases, 4/6 times.
Reply
#7

Your just creating lag.
Reply
#8

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Your just creating lag.
well, no lag on my dedicated at all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)