anti-inv.
#1

Hi,

This code will work if player use health hack?

Code:
public OnPlayerTakeDamage( playerid, issuerid, Float:amount, weaponid)
{
new
  			Float: hp,
    		Float: arm,
     		Float: HitPoints
 		;
  		GetPlayerHealth(playerid, hp);
  		GetPlayerArmour(playerid, arm);
   		HitPoints = hp + arm;

		if(last_hit[playerid] < HitPoints)
		{
 			inv_w[playerid]++;
 		}
  		else
  		{
   			inv_w[playerid] = 0;
   		}
		if(inv_w[playerid] > 12)
		{
 			SendClientMessage(playerid, COLOR_BLUE, "INV");
   			SetTimerEx ( "_Kick", 100, false, "d", playerid );
   		}
    	last_hit[playerid] = HitPoints;
}
Reply
#2

If he use s.0beit no will not work.
Reply
#3

Then, what i need to do, protect and too from ******s?
Reply
#4

You must also consider packet losses or packet excahnge/misorder which might result in hack even when the player hasn't.
Reply
#5

And how you say i can do it?
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=432806 - This was my thread - Dark_Rain answered it
Reply
#7

And how i need to use it?
Reply
#8

You can use THIS, his /hh command detecting s.0beit users. Play with it, and customize it to your specifications.
Reply
#9

But in OnPlayerTakeDamage i have some scripts, like safe zones, when shooter lose hp, and that who hurt get hp. Is this anti-godmode will not kick not cheaters?
Reply
#10

Probably not. You don't have to use the hole script. Take an example:

pawn Code:
new Float:hh1[MAX_PLAYERS];

forward HealthHack(playerid,playa);
public HealthHack(playerid,playa)
{
    new Float:hh2;
    new string[128];
    GetPlayerHealth(playa,hh2);
    if(hh2 == 100)
    {
        format(string,sizeof(string),"%s Was HH Tested By %s And Returned {AA3333}POSITIVE {B4B5B7}for hacks",PlayerNameEX(playa), PlayerNameEX(playerid));
        SendClientMessage(playerid,0xAFAFAFAA,string);
    }
    else
    {
        format(string,sizeof(string),"%s Was HH Tested By %s And Returned {33AA33}NEGATIVE {B4B5B7}for hacks",PlayerNameEX(playa), PlayerNameEX(playerid));
        SendClientMessage(playerid,0xAFAFAFAA,string);
        SetPlayerHealth(playa,hh1[playa]);
    }
    return 1;
}

CMD:hh(playerid, params[])
{
    new playa, level;
    new Float:slx, Float:sly, Float:slz;
    if(sscanf(params, "ui", playa, level))
    {
        SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /hh [playerid/PartOfName] [level 1-2]");
        SendClientMessage(playerid, 0xAFAFAFAA, "HINT:  Level 1(invisible) / Level 2 (visible) (more accurate)");
        return SendClientMessage(playerid, 0xAA3333AA, "WARNING:  Spamming this command will lead to incorrect outcomes");
    }
    if(IsPlayerConnected(playa)) return SendClientMessage(playerid,-1,"Player Not Connected!");
    if(level < 1 || level > 2) return SendClientMessage(playerid, 0xAFAFAFAA, "Level cannot be bellow 1 or above 2");
    if(level == 1)
    {
        new playerState = GetPlayerState(playa);
        if (playerState == PLAYER_STATE_PASSENGER || playerState == PLAYER_STATE_DRIVER)
        {
            GetPlayerPos(playa, slx, sly, slz);
            SetPlayerPos(playa, slx-3, sly, slz);
        }
        GetPlayerHealth(playa,hh1[playa]);
        SetPlayerHealth(playa,100);
        GetPlayerVelocity(playa,slx, sly, slz);
        SetPlayerVelocity(playa,slx, sly, slz-0.375);
        SetTimerEx("HealthHack",200,false,"ii",playerid,playa);
    }
    else if(level == 2)
    {
        GetPlayerHealth(playa,hh1[playa]);
        SetPlayerHealth(playa,100);
        GetPlayerPos(playa, slx, sly, slz);
        SetPlayerPos(playa, slx, sly, slz+10);
        CreateExplosion(slx, sly, slz+10, 12, 1);
        SetTimerEx("HealthHack",500,false,"ii",playerid,playa);
    }
    return 1;
}
You can use it like this, just to use only with a command, maybe when someone report player that have god?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)