AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How can I reduce the dmg? (https://forums.alliedmods.net/showthread.php?t=9452)

Finalheaven 01-19-2005 12:32

How can I reduce the dmg?
 
Of a weapon, let's say the awp? on my server. Any way is fine. Doesn't have to be through amxx. Of which I'm still using .16 HAPPILY! I have the awp and autosnipe limited already, but reducing the damage done would make the awp perfect.

Peli 01-19-2005 20:12

I think the only way is to make a plugin that will change the damage. Ofcourse to do that you have to know how to script.

BlueRaja 01-20-2005 00:28

No, there is no way to change the damage.
Even if you catch the damage event and stop it from reaching the client, the damage is still dealt. We've been through all this before.

You COULD catch the damage event and give health back to the player, but that won't help in the case of AWPs, because the damage is dealt before the plugin can do anything...so if it would have normally been a one-hit kill, it still will.

Although...since the HUD looks the same at 100 and 356...you COULD give the player 356 health, and then if they go under 256 (AFTER giving the health back), you'd slay them...

Sometimes, I amaze me with my ingeniousness.

EKS 01-20-2005 18:17

Damn thats a good idea :)

Finalheaven 01-20-2005 19:10

but wait a second. don't all the weapons have attributes on the server? And we can't control that through server.cfg? We can control crazy stuff like gravity, but not wep dmg?

BlueRaja 01-20-2005 23:18

Yes, everything like that is stored in a variable on the server.
Some of them are cvars that are easily accessable and changable, such as gravity.
Others, however, such as weapon damage and the max/min limits (say, for bomb timer and money) are stored as constants in memory, and would take some serious memory hacking to edit.

Fortunately for us, DS wrote a module that allows to "hack" some of those hidden constants on the server. Variables such as the max/min limits for bomb timer and money are accessable; however, the damage of guns is not.

If you need to change the damage of a gun, use the amazing and incredibly ingenious method I came up with last night while I was half-wasted.

TaRgEt*TuRkEy 01-21-2005 01:11

Well after editing one of Blue Raja's plugins, I realized that when trying to get guns to do more damage, I was actually getting the damage, but not stopping the initial damage, so it was doing double damage plus whatever extra damage I had set for that gun. So what I did was get the damage, apply it to the multiplier, then minus the inital damage value, so it increased with the extra damage, but just that, and no double damage.

Then I started using multiples under 1 (-999 to 0.9) to get a lowered damage value, but the problem still exists, so I started adding health back for lowered damage, just like Blue Raja mentioned. This still doesn't fix the problem, but what I am thinking of doing is actually respawning the player, milliseconds after he has died, and adding that health back to him.

I am wondering if this is possible, to respawn the player in the same place, remove the dead body, the kill/death, and give him back the same weapons.

I know a couple of those would work.

BlueRaja 01-21-2005 02:30

???
Did you not just read my ingenious post!?
It's so ingenious it hurts!
[edit] ...Not to mention that the fact that 'the damage added was a multiple of the damage ADDED ONTO the original damage, which cannot be stopped' was not only written in my original post, but was at the header comments in the source file...
[edit2] Looking back, that seems out of context, and I kept changing my tense [sic]. ^_^
..damn, I'm tired O_o


All times are GMT -4. The time now is 19:29.

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