[Include] Anti Fake Kill
#4

I really don't like this method you should record the death time and if a player has two deaths or more in a certain amount of time then they're fake killing it seems prone to false positives with your method I think. I also disagree with this line maybe they have it defined already and maybe it's completely different than how you have defined it your better off just writing forward() and public() when creating any functions it really serves no purpose to do this but potentially cause problems.

#define function:%0(%1) forward %0(%1); public %0(%1)

One more point, there is no need to use y_hooks I know it's nice but it's not needed when this can work without it and some people may not want to use y_hooks for whatever reason (Even though they should).


Here is my method please keep in mind I don't use OnPlayerDeath() anywhere in the script but here so fake killing does absolutely nothing at all that is why it's set to 10 in 10 seconds.

pawn Код:
#include <YSI\y_hooks>

// Delay until a connection would be ignored
#define         FAKEKILL_DELAY            10000

// Number of times within the connection delay to constitute an attack
#define         FAKEKILL_LIMIT            10

// Connection info
enum FAKEKILLINFO
{
    DeathCount,
    LastDeathTime,
}

static FakekillData[MAX_PLAYERS][FAKEKILLINFO];

hook OnPlayerDeath(playerid, killerid, reason)
{
    if(!IsPlayerNPC(playerid))
    {
        if(GetTickCount() - FakekillData[playerid][LastDeathTime] < FAKEKILL_DELAY)
        {
            FakekillData[playerid][DeathCount]++;
            if(FakekillData[playerid][DeathCount] == FAKEKILL_LIMIT) ProcessHack(playerid, INVALID_PLAYER_ID, PATCH_ANTIFAKEKILL);
        }
        else FakekillData[playerid][DeathCount] = 1;
        FakekillData[playerid][LastDeathTime] = GetTickCount();
    }
    return 1;
}

hook OnPlayerDisconnect(playerid, reason)
{
    FakekillData[playerid][DeathCount] = 0;
    FakekillData[playerid][LastDeathTime] = 0;
    return 1;
}
Reply


Messages In This Thread
OnPlayerFakeKill[v1.2] - by Patrick - 20.12.2013, 22:20
Re: Anti Fake Kill - by Alphlax - 20.12.2013, 22:34
Re: Anti Fake Kill - by Patrick - 20.12.2013, 22:38
Re: Anti Fake Kill - by Pottus - 20.12.2013, 23:39
Re: Anti Fake Kill - by dusk - 01.01.2014, 20:20
Re: Anti Fake Kill - by Pottus - 01.01.2014, 21:37
Re: Anti Fake Kill - by Djole1337 - 02.01.2014, 00:32
Re: Anti Fake Kill - by Patrick - 02.01.2014, 03:21
Re: Anti Fake Kill - by PT - 02.01.2014, 03:37
Re: Anti Fake Kill - by Aliassassin123456 - 02.01.2014, 06:55

Forum Jump:


Users browsing this thread: 1 Guest(s)