SA-MP Forums Archive
How do I kick when player gives damage? - 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: How do I kick when player gives damage? (/showthread.php?tid=603441)



How do I kick when player gives damage? - Dzordzomordzo - 23.03.2016

Hi,
I would like to get some help on how do I kick when a player attacks another player?
I know I can use OnPlayerGiveDamage but how do I use it?


Re: How do I kick when player gives damage? - ChristolisTV - 23.03.2016

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage

And I can create it for you! :

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
    new 
string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
    new 
weaponname[24];
    
GetPlayerName(playeridattackersizeof (attacker));
    
GetPlayerName(damagedidvictimsizeof (victim));
    
Kick(attacker);
    return 
1;

Haven't tested it but it may work! :P


Re: How do I kick when player gives damage? - ]Rafaellos[ - 23.03.2016

Quote:
Originally Posted by ChristolisTV
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage

And I can create it for you! :

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
    new 
string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
    new 
weaponname[24];
    
GetPlayerName(playeridattackersizeof (attacker));
    
GetPlayerName(damagedidvictimsizeof (victim));
    
Kick(attacker);
    return 
1;

Haven't tested it but it may work! :P
If you don't know what is going on, don't even try to help someone.

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    if(damagedid != INVALID_PLAYER_ID)
    {
        Kick(playerid);
    }
    return 1;
}

// OR

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        Kick(issuerid);
    }
    return 1;
}



Re: How do I kick when player gives damage? - Dzordzomordzo - 24.03.2016

Thanks for your help


Re: How do I kick when player gives damage? - NaS - 24.03.2016

If you want an advice, do not use OnPlayerTakeDamage for this, otherwise a player could theoretically send a fake message and get another innocent player kicked.