[Include] weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Uberanwar
Посмотреть сообщение
Код:
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.
Reply

I did that too and still.
Reply

Can you show me the debug messages?
Reply

Quote:
Originally Posted by Jeroen52
Посмотреть сообщение
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

Reply

Quote:
Originally Posted by Uberanwar
Посмотреть сообщение
Here:
Did you set any custom fall damage?

Because the fall damage is logged.
Reply

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
Reply

Quote:
Originally Posted by f0Re3t
Посмотреть сообщение
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?
Reply

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?
Reply

Quote:
Originally Posted by Jeroen52
Посмотреть сообщение
I'm all for making forks when the original owner no longer maintains it, but did you make a pull request?
it would be ugly in relation to the author to create a new repository with its development
Reply

Quote:
Originally Posted by f0Re3t
Посмотреть сообщение
a year ago, is this recent activity?
I don't know where you're getting your commits from but the latest commit I can see is from 2018-03-07T18:58:06Z.
Reply

I can't sync the RPG damage, how can I do this? If a player shoots another player with rpg, he doesn't get damaged
Reply

A year ago? https://github.com/oscar-broman/samp...005fbde1a1de35

That was March 7th, 2018. So not a year, not half a year, not even a quarter of a year, but merely a sixth of a year.

Even so, why did you remove your fork? You had fixes that EVERYONE could've used and most definitely would've appreciated. You could've continued updating the repo with fixes and sending pull requests to the main repo for everyone to use.

Also consider this PR https://github.com/oscar-broman/samp...config/pull/81
Reply

Quote:
Originally Posted by Crayder
Посмотреть сообщение
A year ago? https://github.com/oscar-broman/samp...005fbde1a1de35

That was March 7th, 2018. So not a year, not half a year, not even a quarter of a year, but merely a sixth of a year.

Even so, why did you remove your fork? You had fixes that EVERYONE could've used and most definitely would've appreciated. You could've continued updating the repo with fixes and sending pull requests to the main repo for everyone to use.

Also consider this PR https://github.com/oscar-broman/samp...config/pull/81
okay, maybe I'll think about getting fork and the fixs back.
about this PR - I fixed this crash in my version
regarding the commit - it is accepted from PR, but not a personal update of the system by the author
Reply

Quote:
Originally Posted by f0Re3t
Посмотреть сообщение
okay, maybe I'll think about getting fork and the fixs back.
about this PR - I fixed this crash in my version
regarding the commit - it is accepted from PR, but not a personal update of the system by the author
Can you bring back your fork? I'd like to see your enhancements. I don't personally use weapon-config but it will help others in developoing their own custom damage system.
Reply

yes bring back your fork
Reply

Quote:
Originally Posted by f0Re3t
Посмотреть сообщение
okay, maybe I'll think about getting fork and the fixs back.
about this PR - I fixed this crash in my version
regarding the commit - it is accepted from PR, but not a personal update of the system by the author
Yes you should bring back your fork, would help the users a lot

#bringbackyourfork
Reply

#bringbackyourfork
Reply

#bringbackyourforkiwantedyoutonotproclaimyourselfa samaintainerbutidontwantyoutoremoveyourforkbecause thatforkisyourownshitandyouarentitledtoitlikeiment itledtomyownfork
Reply

Quote:
Originally Posted by ******
Посмотреть сообщение
You could make pull requests as well and get things in the official repository. I happen to know that while slice isn't active here any more he does still pay attention.

And to those complaining about forks and someone else developing the code - this is released under the apache license, so he can.
I never said that he couldn't, I just said that it is weird proclaiming that you're the maintainer when the actual maintainer of the code hasn't been gone for 2 months.

It also splits the development and usage of the code up into two camps.
Reply

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
Why did you switch on the conditionals to floatcmp?
Ain't it does the same and actually faster without it?
O_O

Cause of pawn's weird tag system!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)