24.02.2014, 02:36
(
Последний раз редактировалось Scaleta; 03.03.2014 в 05:16.
Причина: Now on GitHub!
)
Short Pieces of Code - Custom Damage (UPDATED 25/2/2014)
NOTE
If you are using the 0.3z version of this include, please update it to the one currently in the repository.
About
So, I saw a lot of people made "custom damage scripts", but none of these was ever actual custom damage. It simply added onto the current damage and caused problems when the normal damage already killed the player. I first devised the method on the same idea, but it was bugged so I scrapped it. Then, I realized two key pieces missing to the method. 1. Set their team and you can manage the damage yourself. 2. The bug which fatally destroyed my last system.
I am currently using this system, but I still like to contribute to the community as it would be pointless to just keep it to myself.
Notes
The 0.3z version is untested and might not work with all weapons.
The normal version _will_ conflict if you use SetPlayerTeam within your script.
It is suggested that you modify the damages to your liking, as they are not all great amounts.
Current Releases Documentation
The normal version of this include blocks normal SA-MP damage by setting the player's team and then handling the damage when it normally would have been taken.
With this you could factor in damage modifiers with bodypart hits
Example
pawn Код:
// If statement for just one, but you can use a switch for all.
// Do not forget to define the parts, as they are not already in the samp include.
#define BODY_PART_TORSO 3
if(bodypart == BODY_PART_TORSO) damage *= 2.0; // this would be outrageous to increment by, it's an example.
This is meant to be short and sweet, as it is apart of the Short Pieces of Code library.