SA-MP Forums Archive
A Few Things I Want To Know. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A Few Things I Want To Know. (/showthread.php?tid=238419)



A Few Things I Want To Know. - Rokzlive - 11.03.2011

Is it possible to track who punches who and who rams who? Is there a way to do it?

Also, how do i make it so when a player punches, it set him back to normal making the punch not count?


Re: A Few Things I Want To Know. - Kwarde - 11.03.2011

OnPlayerShootPlayer: https://sampforum.blast.hk/showthread.php?tid=195439
I guess it will work with fists. Just add this in your script:

pawn Код:
public OnPlayerShootPlayer( shooter, target, Float:damage )
{
    new Float:tHealth;
    if( GetPlayerWeapon( shooter ) == 0 || GetPlayerWeapon( shooter ) == 1 ) {
        GetPlayerHealth( target, tHealth );
        SetPlayerHealth( target, tHealth + damage ); //Can be bugged with armour
    }
    return 1;
}
I guess that that'll work. You can also detect when a player presses 'LMB' and deny that for other players (stop syncing). Or just freeze/unfreeze him.