SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 21/04/2018, 07:20 PM   #751
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 861
Reputation: 71
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Uberanwar View Post
I got a weird issue, falling and explosions does not affect my health.
Can you show your OnPlayerDamage?
__________________
Jeroen52 is offline   Reply With Quote
Old 21/04/2018, 07:26 PM   #752
Uberanwar
Gangsta
 
Uberanwar's Avatar
 
Join Date: May 2012
Location: Malaysia
Posts: 817
Reputation: 62
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Jeroen52 View Post
Can you show your OnPlayerDamage?
Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{	
	if (weapon == WEAPON_CARPARK || weapon == WEAPON_HELIBLADES) // Disable helikill and carpark
		return false;

	new avg_rate = AverageShootRate(issuerid, 2);

	// Lower rapid fire damage
	if (avg_rate != -1) {
		if (weapon == WEAPON_DEAGLE && avg_rate < 500) {
			amount /= 1.4;
		} else if (weapon == WEAPON_SHOTGSPA && avg_rate < 250) {
			amount /= 1.4;
		}
	}

	// Silencer headshot
	if (weapon == WEAPON_SILENCED && bodypart == 9) {
		amount = 30.0;
	}

	// Rifle headshot
	if (weapon == WEAPON_RIFLE && bodypart == 9)
	{
		amount /= 0.75;
	}

	// Sniper headshot
	if (weapon == WEAPON_SNIPER && bodypart == 9) {
		if (amount == 30.0) {
			amount = 40.0;
		} else if (amount == 35.0) {
			amount = 40.0;
		} else if (amount == 45.0) {
			amount = 50.0;
		}
	}
	return true;
}
Uberanwar is offline   Reply With Quote
Old 21/04/2018, 07:38 PM   #753
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 861
Reputation: 71
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Uberanwar View Post
Code:
public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{	
	if (weapon == WEAPON_CARPARK || weapon == WEAPON_HELIBLADES) // Disable helikill and carpark
		return false;

	new avg_rate = AverageShootRate(issuerid, 2);

	// Lower rapid fire damage
	if (avg_rate != -1) {
		if (weapon == WEAPON_DEAGLE && avg_rate < 500) {
			amount /= 1.4;
		} else if (weapon == WEAPON_SHOTGSPA && avg_rate < 250) {
			amount /= 1.4;
		}
	}

	// Silencer headshot
	if (weapon == WEAPON_SILENCED && bodypart == 9) {
		amount = 30.0;
	}

	// Rifle headshot
	if (weapon == WEAPON_RIFLE && bodypart == 9)
	{
		amount /= 0.75;
	}

	// Sniper headshot
	if (weapon == WEAPON_SNIPER && bodypart == 9) {
		if (amount == 30.0) {
			amount = 40.0;
		} else if (amount == 35.0) {
			amount = 40.0;
		} else if (amount == 45.0) {
			amount = 50.0;
		}
	}
	return true;
}
Try to put somewhere near the top that if the issuerid == UNKNOWN_PLAYER_ID and if it is fall/explosions damage that it returns true.
__________________
Jeroen52 is offline   Reply With Quote
Old 21/04/2018, 08:42 PM   #754
Uberanwar
Gangsta
 
Uberanwar's Avatar
 
Join Date: May 2012
Location: Malaysia
Posts: 817
Reputation: 62
Default Re: weapon-config.inc - Damage system with many features

I did that too and still.
Uberanwar is offline   Reply With Quote
Old 21/04/2018, 08:52 PM   #755
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 861
Reputation: 71
Default Re: weapon-config.inc - Damage system with many features

Can you show me the debug messages?
__________________
Jeroen52 is offline   Reply With Quote
Old 21/04/2018, 09:06 PM   #756
Uberanwar
Gangsta
 
Uberanwar's Avatar
 
Join Date: May 2012
Location: Malaysia
Posts: 817
Reputation: 62
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Jeroen52 View Post
Can you show me the debug messages?
Here:

Quote:
[23:58:25] (wc:0) Requested class: 0
[23:58:25] (wc:0) True death class selection
[23:58:32] (wc:0) vz: 0.000000 anim: 1132 prev: 1189
[23:58:32] (wc:0) vz: 0.000000 anim: 1133 prev: 1132
[23:58:41] (wc:0) vz: -0.104591 anim: 1130 prev: 1195
[23:58:42] (wc:0) OnPlayerTakeDamage(0 took 34.728229 from 65535 by 54 on bodypart 3)
[23:58:42] (wc:0) vz: 0.000000 anim: 1208 prev: 1130
[23:58:42] (wc:0) fall dmg: 18.67585 (vz: -0.498813, anim: 1208, prev: 1130)
[23:58:55] (wc:0) vz: -0.105296 anim: 1130 prev: 1195
[23:58:56] (wc:0) OnPlayerTakeDamage(0 took 39.880088 from 65535 by 54 on bodypart 3)
[23:58:56] (wc:0) vz: 0.000000 anim: 1208 prev: 1130
[23:58:56] (wc:0) fall dmg: 21.54522 (vz: -0.544723, anim: 1208, prev: 1130)
[23:59:06] (wc:0) vz: -0.102363 anim: 1130 prev: 1195
[23:59:07] (wc:0) OnPlayerTakeDamage(0 took 34.832263 from 65535 by 54 on bodypart 3)
[23:59:07] (wc:0) vz: 0.000000 anim: 1208 prev: 1130
[23:59:07] (wc:0) fall dmg: 19.39770 (vz: -0.510363, anim: 1208, prev: 1130)
[23:59:28] (wc:0) OnPlayerTakeDamage(0 took 82.500000 from 65535 by 51 on bodypart 3)
[23:59:29] (wc:0) vz: -0.106083 anim: 1130 prev: 1189
[23:59:30] (wc:0) OnPlayerTakeDamage(0 took 38.225410 from 65535 by 54 on bodypart 3)
[23:59:30] (wc:0) vz: 0.000000 anim: 1208 prev: 1130
[23:59:30] (wc:0) fall dmg: 20.57295 (vz: -0.529167, anim: 1208, prev: 1130)
[23:59:34] (wc:0) OnPlayerTakeDamage(0 took 82.500000 from 65535 by 51 on bodypart 3)
[23:59:36] (wc:0) OnPlayerTakeDamage(0 took 82.500000 from 65535 by 51 on bodypart 3)
[23:59:38] (wc:0) OnPlayerTakeDamage(0 took 82.500000 from 65535 by 51 on bodypart 3)
[23:59:38] (wc:0) vz: -0.146315 anim: 1133 prev: 1257
[23:59:39] (wc:0) OnPlayerTakeDamage(0 took 82.500000 from 65535 by 51 on bodypart 3)
[23:59:40] (wc:0) vz: -0.140734 anim: 1133 prev: 1257
Uberanwar is offline   Reply With Quote
Old 21/04/2018, 09:16 PM   #757
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 861
Reputation: 71
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Uberanwar View Post
Here:
Did you set any custom fall damage?

Because the fall damage is logged.
__________________
Jeroen52 is offline   Reply With Quote
Old 26/04/2018, 06:10 PM   #758
f0Re3t
Little Clucker
 
Join Date: Aug 2015
Posts: 30
Reputation: 3
Default Re: weapon-config.inc - Damage system with many features

since the author apparently threw the development, I would like to continue it
I created a fork of the project and continue it
you can download the updated version here has been deleted
if you find any bug, please let me know here has been deleted
at this point I have quite enough fixes for this project

Last edited by f0Re3t; 30/04/2018 at 01:49 PM.
f0Re3t is offline   Reply With Quote
Old 26/04/2018, 07:42 PM   #759
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 861
Reputation: 71
Default Re: weapon-config.inc - Damage system with many features

Quote:
Originally Posted by f0Re3t View Post
since the author apparently threw the development, I would like to continue it
I created a fork of the project and continue it
you can download the updated version here https://github.com/f0Re3t/samp-weapon-config
if you find any bug, please let me know here https://github.com/f0Re3t/samp-weapon-config/issues
at this point I have quite enough fixes for this project
I'm all for making forks when the original owner no longer maintains it, but did you make a pull request?
__________________
Jeroen52 is offline   Reply With Quote
Old 26/04/2018, 08:10 PM   #760
Assish
Little Clucker
 
Join Date: Apr 2018
Posts: 10
Reputation: 0
Default Re: weapon-config.inc - Damage system with many features

I switched to this system and it's much better than the standard sync, however I have a problem with vehicle friendly fire, players from same teams can damage each others vehicles, how can this be fixed?
Assish is offline   Reply With Quote
Reply

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
Help with weapon damage system thanks JessThompson Scripting Help 7 15/07/2014 01:01 PM
[FilterScript] New Weapon Damage System [0.3z] RenSoprano Filterscripts 6 17/01/2014 06:03 AM
[FilterScript] Weapon damage system [v1.0] Darnell Filterscripts 74 21/10/2013 08:53 PM
[FilterScript] Weapon Damage System Donicans Filterscripts 14 06/11/2012 01:22 PM
[FilterScript] Realistic Weapon Damage And Death System [V1.0][New Cool FS] Nirzor Filterscripts 6 08/08/2012 05:34 AM


All times are GMT. The time now is 05:18 PM.


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