SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/07/2017, 10:16 AM   #1
Hunud
Huge Clucker
 
Join Date: Jun 2016
Posts: 460
Reputation: 8
Default Fake Kill

Hi,

Is this a good Anti Fake Kill ? If not how to make it more success +REP if helped

Code:
//anti fake kill
new antifakekill[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
    antifakekill[playerid] ++;
    SetTimerEx("antifakekill2", 1000,false,"i",playerid);
return 1;
}
forward antifakekill2(playerid);
public antifakekill2(playerid)
{
    antifakekill[playerid] --;
    if(antifakekill[playerid] > 3)
    {
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"* %s was banned reason (Fake kill)",pName);
    SendClientMessageToAll(0xFF0000FF,string);
    BanEx(playerid, "Fake kill");
    }
    return 1;
}
__________________
Hunud is offline   Reply With Quote
Old 17/07/2017, 02:01 PM   #2
Arbico
Little Clucker
 
Arbico's Avatar
 
Join Date: Jul 2017
Posts: 37
Reputation: 1
Default Re: Fake Kill

I think you are trying to ban all players that have a hack that kills themself with
But the code you wrote will ban all players that died more than 3 times
If the killer kills the player 3 times
the player will get banned, Even though they didn't hack
That also applies for people that commited suicide
Arbico is offline   Reply With Quote
Old 17/07/2017, 02:17 PM   #3
Freedom.
Big Clucker
 
Join Date: Oct 2012
Location: Turkey
Posts: 137
Reputation: 8
Default Re: Fake Kill

Code:
    if(killerid != INVALID_PLAYER_ID && playerid == killerid)
	{
		return Kick(playerid);
	}
	
    if(GetPVarInt(playerid, "last_died_at") > GetTickCount())
	{
		Kick(playerid);
		return 1;
	}
	SetPVarInt(playerid, "last_died_at", GetTickCount()+500);
Freedom. is offline   Reply With Quote
Old 17/07/2017, 02:20 PM   #4
Arbico
Little Clucker
 
Arbico's Avatar
 
Join Date: Jul 2017
Posts: 37
Reputation: 1
Default Re: Fake Kill

Quote:
Originally Posted by Freedom. View Post
Code:
    if(killerid != INVALID_PLAYER_ID && playerid == killerid)
	{
		return Kick(playerid);
	}
	
    if(GetPVarInt(playerid, "last_died_at") > GetTickCount())
	{
		Kick(playerid);
		return 1;
	}
	SetPVarInt(playerid, "last_died_at", GetTickCount()+500);
This will cause only people that commit suicide to get kicked, Look closely
If the killer is the player, kick the player, which if someone fall from a high place, will get kicked, because he killed himself, Think a bit before u script
__________________
Code:
public OnPlayerConnect(playerid) {
     SendClientMessage(playerid, COLOR_RED, "THIS IS MY SERVER!");
     Ban(playerid);
     return 1;
}
Arbico is offline   Reply With Quote
Old 17/07/2017, 02:25 PM   #5
FailerZ
Huge Clucker
 
FailerZ's Avatar
 
Join Date: Oct 2013
Location: 33.5138° N, 36.2765° E
Posts: 222
Reputation: 20
Default Re: Fake Kill

Quote:
Originally Posted by Arbico View Post
I think you are trying to ban all players that have a hack that kills themself with
But the code you wrote will ban all players that died more than 3 times
If the killer kills the player 3 times
the player will get banned, Even though they didn't hack
That also applies for people that commited suicide
No...Don't you see the timer? It is actually if player died 3 times in one second he will get banned.
__________________
[FilterScript]Digital Health & Armour [DHA]
[FilterScript]Labels Creator [LC]
[FilterScript]Debug Mode [D-Mode]
[FilterScript]Advance Fish System [AFS]
FailerZ is offline   Reply With Quote
Old 17/07/2017, 02:26 PM   #6
Freedom.
Big Clucker
 
Join Date: Oct 2012
Location: Turkey
Posts: 137
Reputation: 8
Default Re: Fake Kill

Quote:
Originally Posted by Arbico View Post
This will cause only people that commit suicide to get kicked, Look closely
If the killer is the player, kick the player, which if someone fall from a high place, will get kicked, because he killed himself, Think a bit before u script
I currently use this thing in my server there is no wrong fake-kill.
Freedom. is offline   Reply With Quote
Old 17/07/2017, 02:32 PM   #7
Hunud
Huge Clucker
 
Join Date: Jun 2016
Posts: 460
Reputation: 8
Default Re: Fake Kill

So, Should i use this or ?
__________________
Hunud is offline   Reply With Quote
Old 17/07/2017, 03:32 PM   #8
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,402
Reputation: 403
Default Re: Fake Kill

Use it if you want innocent players banned. Some things you can do to check for fake kills are: distance between the "killer" & the victim (who is the one hacking), weapon used, if any damage was passed through Take/GiveDamage or other functions, etc.
Abagail is online now   Reply With Quote
Old 17/07/2017, 03:51 PM   #9
Freedom.
Big Clucker
 
Join Date: Oct 2012
Location: Turkey
Posts: 137
Reputation: 8
Default Re: Fake Kill

Quote:
Originally Posted by Abagail View Post
Use it if you want innocent players banned. Some things you can do to check for fake kills are: distance between the "killer" & the victim (who is the one hacking), weapon used, if any damage was passed through Take/GiveDamage or other functions, etc.
Distance won't work. For example when you give damage somebody and he types /kill. The system will kick wrong person.
Freedom. is offline   Reply With Quote
Old 17/07/2017, 04:14 PM   #10
Arbico
Little Clucker
 
Arbico's Avatar
 
Join Date: Jul 2017
Posts: 37
Reputation: 1
Default Re: Fake Kill

If you really want to make it, The best option for you is to use timers
Where u can just set a timer when the player get killed, if the player died again and that timer is not finished,he gets banned
But that timer must be short
from 3 to 7 seconds
__________________
Code:
public OnPlayerConnect(playerid) {
     SendClientMessage(playerid, COLOR_RED, "THIS IS MY SERVER!");
     Ban(playerid);
     return 1;
}
Arbico is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kill hack / fake kill iDark Server Support 1 22/05/2017 10:17 AM
[FilterScript] Ant Fake-Kill Mandrack_FreeZe Lançamentos/Releases 9 16/12/2014 11:55 AM
[Ajuda] Fake kill Don_Speed Português/Portuguese 9 28/01/2014 09:21 PM
[Off] Fake Kill iMix Português/Portuguese 1 26/01/2014 06:54 PM
[Ajuda] Ant Fake Kill matheuspain Português/Portuguese 11 23/07/2012 04:25 PM


All times are GMT. The time now is 02:49 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.