SA-MP Forums Archive
I need help about blocking Self Kill Hack ! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I need help about blocking Self Kill Hack ! (/showthread.php?tid=653361)



I need help about blocking Self Kill Hack ! - DeathCore - 02.05.2018

Hello Sa-mp!

I'm here to ask for your help and wanted to know how I block this "SELF KILLING HACK" with a script under OnPlayerDeath public.

Video example: https://www.youtube.com/watch?v=AXZWoWON2VI


Re: I need help about blocking Self Kill Hack ! - SkmDanny - 02.05.2018

PHP код:
new SuicideAttempts[MAX_PLAYERS];
public 
OnPlayerDeath(playeridkillerid)
{
    if(
killerid != INVALID_PLAYER_ID)
    {
        
PlayerInfo[killerid][Kills] ++; 
        
PlayerInfo[playerid][Deaths] ++; 
    }
    if(
killerid == playerid)
    {
        
SuicideAttempts[playerid] ++;
    }
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    if(
SuicideAttempts[playerid] >= 3)
    {
        new 
string[128];
        
format(stringsizeof(string), "%s has been kicked by AdmBot for Fake Kill."GetName(playerid));
        
SendClientMessageToAll(0xFF0000FFstring);
        
SendClientMessage(playerid0xFF0000FF"You have been kicked for Fake Kill");
        
Kick(playerid);
    }
    return 
1;
}
stock GetName(playerid)
{
    new 
pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNamesizeof(pName));
    return 
pName;




Re: I need help about blocking Self Kill Hack ! - DeathCore - 02.05.2018

Quote:
Originally Posted by SkmDanny
Посмотреть сообщение
PHP код:
new SuicideAttempts[MAX_PLAYERS];
public 
OnPlayerDeath(playerid)
{
    if(
killerid != INVALID_PLAYER_ID)
    {
        
PlayerInfo[killerid][Kills] ++; 
        
PlayerInfo[playerid][Deaths] ++; 
    }
    if(
killerid == playerid)
    {
        
SuicideAttempts[playerid] ++;
    }
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    if(
SuicideAttempts[playerid] >= 3)
    {
        new 
string[128];
        
format(stringsizeof(string), "%s has been kicked by AdmBot for Fake Kill."GetName(playerid));
        
SendClientMessageToAll(0xFF0000FFstring);
        
SendClientMessage(playerid0xFF0000FF"You have been kicked for Fake Kill");
        
Kick(playerid);
    }
    return 
1;
}
stock GetName(playerid)
{
    new 
pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNamesizeof(pName));
    return 
pName;

Thanks for the idea