SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 24/02/2014, 03:36 AM   #1
Big Clucker
Join Date: May 2013
Posts: 88
Reputation: 29
Default [SPC] Custom Damage (Now on GitHub!)

Short Pieces of Code - Custom Damage (UPDATED 25/2/2014)


If you are using the 0.3z version of this include, please update it to the one currently in the repository.


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.


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

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

pawn Code:
// 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.
if(bodypart == BODY_PART_TORSO) damage *= 2.0; // this would be outrageous to increment by, it's an example.

The 0.3z version uses the OnPlayerWeaponShot, handles the damage and then blocks the shot (this part was untested, compared to the normal). I only made this version to allow compatibility with servers that use multiple teams.

This is meant to be short and sweet, as it is apart of the Short Pieces of Code library.
Developer at Next Generation Gaming

Last edited by Scaleta; 03/03/2014 at 06:16 AM. Reason: Now on GitHub!
Scaleta is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about custom damage Voxel Scripting Help 5 18/01/2014 12:36 AM
[FilterScript] Easy custom damage + damage sound Voxel Filterscripts 14 30/09/2013 05:07 PM
How to detect vehicle damage, and get damage taken? Micius Scripting Help 4 31/07/2013 05:08 PM
Custom weapon damage problems with kill-logs? Mado Scripting Help 2 08/01/2013 09:43 AM
[Include] Car damage system - Damage a car without a driver! The_Moddler Includes 68 30/03/2012 02:38 AM

All times are GMT. The time now is 03:08 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.