Anti FakeKill. -
AfikAtashga - 29.01.2014
Hello,
i got some problems with my anti-fakekill.
OnPlayerDeath:
Код:
SetPVarInt(playerid, "RemoveDeaths", GetPVarInt(playerid, "RemoveDeaths")+1);
if(GetPVarInt(playerid, "RemoveDeaths") == 2) Kick(playerid);
SetTimerEx("RemoveDeaths", 2000, false, "i", playerid);
if(killerid != INVALID_PLAYER_ID)
{
new Float:life, Float:p_pos[3];
GetPlayerPos(playerid, p_pos[0], p_pos[1], p_pos[2]);
GetPlayerHealth(playerid, life);
if(GetPlayerWeapon(killerid) != reason || IsPlayerNPC(killerid) || !IsPlayerInRangeOfPoint(killerid, 65.0, p_pos[0], p_pos[1], p_pos[2]))
{
SetPVarInt(playerid, "FakeKill", GetPVarInt(playerid, "FakeKill")+1);
SetPVarInt(playerid, "FakeKillTimer", SetTimerEx("ResetFakeKill", 10*1000, false, "i", playerid));
for(new i, j = MAX_PLAYERS; i < j; i++) if(IsPlayerConnected(i) && player[i][adminlevel] != 0 && !IsPlayerNPC(i))
{
format(message, sizeof(message), "** %s using FakeKill", getname[playerid]);
log_write("AntiCheat", message);
SendFormatMessage(i, color_white, message, "** {FF0000}%s {FFFFFF}has using hacks (reason: FakeKill Hack)", getname[playerid]);
}
if(GetPVarInt(playerid, "FakeKill") == 2) return Kick(playerid);
return false;
}
}
I dont know why those codes doesn't works.
A normally fake kill it's blocked. But some players trying to attack my server, inside, they get to the server & in 1 minute or less, more then 100,000 attacks!
I dont have any idea why it isn't blocked them , and normally attacks its block.
Thanks!
Re: Anti FakeKill. -
Abagail - 29.01.2014
I would suggest using OnPlayerTakeDamage to see if they've taken damage. If they haven't taken any damage what-so-ever and OnPlayerDeath is called there most likely using Fake-Kill. You can find more information on OnPlayerTakeDamage, by going to the link below or clicking
here:
https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
Re: Anti FakeKill. -
SwisherSweet - 29.01.2014
Let me just make a anti fake kill for u
pawn Код:
new time = gettime( );//Get the current time
switch( time - LastDeath[ playerid ] )//the time of the last death
{
case 0 .. 3://3 kills quickly
{
DeathSpam{ playerid } ++;
if( DeathSpam{ playerid } == 3 )//If player get's killed 3 times in a row
{//Result below...
//Your ban message here, Like SendClientMessage(Put ur ban function here!!!)
return 1;
}
}
default: DeathSpam{ playerid } = 0;//put death spam back to zero...
}
I know this works because this is like the exact one I use for my server!
Re: Anti FakeKill. -
AfikAtashga - 30.01.2014
The problem isn't to block the fakekill, the normally fakekill have been blocked, but they some-how can "ignore" the system.
Re: Anti FakeKill. -
SwisherSweet - 30.01.2014
Than it's not banned the player...
Why would you make it send the admins a message how does that even help?
If you want a good anti-cheat make it ban the player when it detects hacks...
Ill give you and example...
pawn Код:
function BanAnAsshole(targetid, adminname[], playername[], reason[])
{
new str[128];
format(str, sizeof(str), "%s Has banned %s. Reason: %s ", adminname, playername, reason);
SendClientMessageToAll(COLOR_RED, str);
Ban(targetid);
return 1;
}
BanAnAsshole(targetid, "Anti-Bot", "Player[targetid][name]", "Player[targetid][name]", "Fake-Killing");//Put this where You wanna ban the player...