SA-MP Forums Archive
OnPlayerTakeDamage - 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: OnPlayerTakeDamage (/showthread.php?tid=549710)



OnPlayerTakeDamage - Clarck - 08.12.2014

hello how can I make the player receive wanted level when punch someone??


Re: OnPlayerTakeDamage - Dziugsas - 08.12.2014

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
    
SetPlayerWantedLevel(playerid,level);
    return 
1;




Re: OnPlayerTakeDamage - Schneider - 08.12.2014

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(weaponid == 0)
        {
            new level = GetPlayerWantedLevel(issuerid);
            SetPlayerWantedLevel(issuerid, (level+1))
        }
    }
    return 1;
}
Edit: I wasn't aware of the existence of OnPlayerGiveDamage, so Dziugsas's code is easier, but add the weaponid-check from my code to see if the player used his fists.


Re: OnPlayerTakeDamage - Clarck - 08.12.2014

thanks ... I will do
+ rep