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

cool thing thanks a lot !
Reply

This is a great include.
Reply

Is there any version fixing the y_hooks conflict?
Reply

How to delay the death of the player who got headshooted ?

I'm using the 2 sec Timer to set his health to 0 using SetPlayerHealth(playerid,0); but the problem is in deathlist it showing he got killed by no one like he did /kill .
I'm doing this right now. this was working fine with OnPlayerTakeDamage before but after changing it to OnPlayerDamage it's not working like it was.
Код:
public OnPlayerHeadshot(Float:Ax, Float:Ay, Float:Az, playerid)
{
	KillTimer(HeadshotTimer[playerid]);
 	DestroyObject(blood[playerid]);
        SetPLayerHealth(playerid,0); 
	return 1;
}
Should i do this?
Код:
public OnPlayerHeadshot(Float:Ax, Float:Ay, Float:Az, playerid,Float:amount)
{
	KillTimer(HeadshotTimer[playerid]);
 	DestroyObject(blood[playerid]);
        amount = 0.0;
	return 1;
}
Reply

Quote:
Originally Posted by MBilal
Посмотреть сообщение
How to delay the death of the player who got headshooted ?

I'm using the 2 sec Timer to set his health to 0 using SetPlayerHealth(playerid,0); but the problem is in deathlist it showing he got killed by no one like he did /kill .
I'm doing this right now. this was working fine with OnPlayerTakeDamage before but after changing it to OnPlayerDamage it's not working like it was.
Код:
public OnPlayerHeadshot(Float:Ax, Float:Ay, Float:Az, playerid)
{
	KillTimer(HeadshotTimer[playerid]);
 	DestroyObject(blood[playerid]);
        SetPLayerHealth(playerid,0); 
	return 1;
}
Should i do this?
Код:
public OnPlayerHeadshot(Float:Ax, Float:Ay, Float:Az, playerid,Float:amount)
{
	KillTimer(HeadshotTimer[playerid]);
 	DestroyObject(blood[playerid]);
        amount = 0.0;
	return 1;
}
You could try to do it with OnPlayerPrepareDeath or OnPlayerDeathFinished.
But I recommend you to view https://github.com/oscar-broman/samp-weapon-config anyways.
Reply

Should I include this before fixes.inc?
Reply

Quote:
Originally Posted by Nubik
View Post
Why isn't OnPlayerGiveDamage and OnPlayerTakeDamage hooked while all other callbacks/functions are hooked?

I'm using BustAim and when I include weapon-config before BustAim it gives me this error:
Code:
symbol already defined: "OnPlayerGiveDamage"
Should I include BustAim before weapon-config?
I'm including BustAim before weapon-config and it works.
Reply

Where it is better to apply this piece, on RP servers or on DM? The fact that the RP can come in handy in some mini-games. And the system itself is very good and as an addition and as a separate component.
Reply

0.3DL please!
Reply

Weapon Config my forked version 0.3.DL https://github.com/MaxAndolini/samp-weapon-config
SKY Plugin 0.3.DL version http://forum.sa-mp.com/showpost.php?...&postcount=137
Reply

Quote:
Originally Posted by Max_Andolini
Посмотреть сообщение
What is the difference between this and the existing one except, as I see, only my pull request and lots of space added after for and if.
Quote:
Originally Posted by TaylorShade
Посмотреть сообщение
I included weapon-config.inc and when i shoot someone he isn't losing health, also when he shoots me same problem.. i got this from crashdetect
Код:
[19:05:04] [debug] Run time error 11: "Divide by zero"
[19:05:04] [debug] AMX backtrace:
[19:05:04] [debug] #0 00000f78 in AverageShootRate (playerid=0, shots=1, &multiple_weapons=@00000000 0) at C:\Users\stefan\Desktop\Fusion Gaming NEW\Compiler\include\weapon-config.inc:981
[19:05:04] [debug] #1 00012b10 in public OnPlayerWeaponShot (playerid=0, weaponid=24, hittype=1, hitid=1, Float:fX=-0.19580, Float:fY=0.07214, Float:fZ=0.47790) at C:\Users\stefan\Desktop\Fusion Gaming NEW\Compiler\include\weapon-config.inc:3450
[19:05:06] [debug] Run time error 11: "Divide by zero"
[19:05:06] [debug] AMX backtrace:
[19:05:06] [debug] #0 00000f78 in AverageShootRate (playerid=0, shots=1, &multiple_weapons=@00000000 0) at C:\Users\stefan\Desktop\Fusion Gaming NEW\Compiler\include\weapon-config.inc:981
[19:05:06] [debug] #1 00012b10 in public OnPlayerWeaponShot (playerid=0, weaponid=24, hittype=1, hitid=1, Float:fX=-0.01489, Float:fY=0.11218, Float:fZ=0.68402) at C:\Users\stefan\Desktop\Fusion Gaming NEW\Compiler\include\weapon-config.inc:3450
[19:05:06] [debug] Run time error 11: "Divide by zero"
Can you compile the gamemode with -d3 flag?

create a pawn.cfg file in `pawno` folder and re-compile the gamemode

EDIT: nvm, found why.


https://github.com/Kaperstone/samp-weapon-config
I assume that if it already divides by zero, then it should return 1.

Actually, 1, and the other function might return the same, lemme edit it as well.
EDIT2: done.
Reply

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
What is the difference between this and the existing one except, as I see, only my pull request and lots of space added after for and if.

Can you compile the gamemode with -d3 flag?

create a pawn.cfg file in `pawno` folder and re-compile the gamemode

EDIT: nvm, found why.
I added this and your fix.

http://forum.sa-mp.com/showpost.php?...&postcount=734
Reply

Quote:
Originally Posted by Max_Andolini
Посмотреть сообщение
Alright, add also the divide by zero for people using the average hit/shots


I don't know whether Slice will merge the pull requests.
Reply

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
Alright, add also the divide by zero for people using the average hit/shots


I don't know whether Slice will merge the pull requests.
I will be interested when I am available.
Reply

How to remove the death animation so its default is it possible?
Reply

Quote:
Originally Posted by IdonTmiss
Посмотреть сообщение
How to remove the death animation so its default is it possible?
Comment this line
https://github.com/oscar-broman/samp...nfig.inc#L4813
in your source


If you want to disable specific death animation, modify this part.
https://github.com/oscar-broman/samp...nfig.inc#L4682
Reply

I can disable or fix this problem: custom health/armour bar? Because over the player 0 health is drawn on top and when the damage is taken, the health/armour bar value does not change
Reply

I got a weird issue, falling and explosions does not affect my health.
Reply

Quote:
Originally Posted by Uberanwar
Посмотреть сообщение
I got a weird issue, falling and explosions does not affect my health.
Can you show your OnPlayerDamage?
Reply

Quote:
Originally Posted by Jeroen52
Посмотреть сообщение
Can you show your OnPlayerDamage?
Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 15 Guest(s)