AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Increase knife damage for me (https://forums.alliedmods.net/showthread.php?t=309197)

LemoNSK 07-17-2018 05:49

Increase knife damage for me
 
Hello,

I'd like to ask you if anyone knows how to increase knife damage ONLY for the 'id' (for the people who choose that they want their damage increased).

I have done this before but when I clicked it, it automatically increased the damage to all the server.


Thanks forwardly.

Natsheh 07-17-2018 05:57

Re: Increase knife damage for me
 
Search , and you are in the wrong forum, for suggestion and request please post in the suggestion and requests forum.

LemoNSK 07-17-2018 06:26

Re: Increase knife damage for me
 
You could at least give me a suggestion for that .. I've been looking for that for hours..

Ghosted 07-17-2018 06:50

Re: Increase knife damage for me
 
Hook TakeDamage function by Ham & check if damage bits is equal to DMG_SLASH. (Not tested)

public [HookedFunctionName](VictimID, InflictorID, AttackerID, Float:Damage, DamageBits)
{
...
}

LemoNSK 07-17-2018 07:01

Re: Increase knife damage for me
 
Quote:

Originally Posted by Ghosted (Post 2604187)
Hook TakeDamage function by Ham & check if damage bits is equal to DMG_SLASH. (Not tested)

public [HookedFunctionName](VictimID, InflictorID, AttackerID, Float:Damage, DamageBits)
{
...
}


Well, it doesn't work this way, but thank you for your reply.

Ghosted 07-17-2018 07:19

Re: Increase knife damage for me
 
Quote:

Originally Posted by LemoNSK (Post 2604191)
Well, it doesn't work this way, but thank you for your reply.

Have you tested?

LemoNSK 07-17-2018 07:39

Re: Increase knife damage for me
 
Quote:

Originally Posted by Ghosted (Post 2604194)
Have you tested?

Yes, nothing happened. I added only what you typed. But it makes no sense to me why this exactly.

Ghosted 07-17-2018 07:40

Re: Increase knife damage for me
 
Quote:

Originally Posted by LemoNSK (Post 2604199)
Yes, nothing happened. I added only what you typed. But it makes no sense to me why this exactly.

Then you should post in plugin requests and not in scripting help section.

Natsheh 07-17-2018 08:41

Re: Increase knife damage for me
 
Instead of checking if the dmg contain dmg_slash check if the attacker is valid, he is not the victim and hes holding a knife.

Also hook takedmg pre, use HamSetParamFloat to change the amount of dmg...
HamSetParamFloat(4, newdmg)

OciXCrom 07-17-2018 08:45

Re: Increase knife damage for me
 
Quote:

Originally Posted by Natsheh (Post 2604217)
Instead of checking if the dmg contain dmg_slash check if the attacker is valid, he is not the victim and hes holding a knife.

Also hook takedmg pre, use HamSetParamFloat to change the amount of dmg...
HamSetParamFloat(4, newdmg)

And if the inflictor is the same as the attacker.


All times are GMT -4. The time now is 12:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.