Displaying bullet damage with HamSandwich
Hi. I got some problems with damage display using HamSandwich.
Code:
For example use Glock's Burst-Fire mode and shoot to other player's head. It will show 96 while the other player is dead. Anyone can suggest how to fix this? |
Re: Displaying bullet damage with HamSandwich
try to take a look into amxx super
|
Re: Displaying bullet damage with HamSandwich
Quote:
Anyway, i tried the same thing 2 weeks ago, and i maked the floatround before set_hudmessage, creating a variable. PHP Code:
|
Re: Displaying bullet damage with HamSandwich
It's clear with Glock. But still sometimes shows 10 more or less damage than the player lost.
Going to use 'Damage' event until someone will find out how to fix it. EDIT: Also the floatround is a bit tricky in this case because it displays number which has +-1 difference from the real taken damage. I mean if I do 1.1 damage, floatround will make it 1, but the victim get 2 dmg, because it's more than 1. Any ideas how to solve it? |
Re: Displaying bullet damage with HamSandwich
Well, i think it will always make 2dmg if it was 1.1 or other values between 1.1 and 1.9 . If you set the player's health at 1.x it will automatically change to 2 (hl)
|
Re: Displaying bullet damage with HamSandwich
Yes. But if the fFloat = 1.1, floatround(fFloat) = 1. So if I do 20.1 damage, player will lose 21 HP but it will print that he lost 20.
|
Re: Displaying bullet damage with HamSandwich
Damage (arg4) is not the damage that the player will actually take.
It depends on DMG_TYPE, wepon, distance, armor... To retrieve real damage, register the forward as post (as you did), and check pev_dmg_take player value. |
Re: Displaying bullet damage with HamSandwich
Thanks. Another question.
Code:
(example code, skipped connected/alive checks) I want to print not only the total damage, but also the starting damage (which was multiplied) and multiplier. All in the same message. Like this: You've made a critical hit: normal dmg: 10, dmg multiplier: 2, total dmg: 20 Of course I could do this with some global variables, but isn't there another way? |
Re: Displaying bullet damage with HamSandwich
I don't know if final damage (pev_dmg_take) is proportional to initial damage, but if it is, this should work :
PHP Code:
|
Re: Displaying bullet damage with HamSandwich
It works. Just one edit:
Code:
Code:
|
| All times are GMT -4. The time now is 01:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.