AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   'controlling' damage taken (https://forums.alliedmods.net/showthread.php?t=45591)

commonbullet 10-06-2006 14:35

'controlling' damage taken
 
I’m trying control damage taken by a player depending on his health; is there a way to reduce or block damages to a player? I tried to hook “Damage” messages and recover the damage taken, it would work unless the player gets a damage that sets his health to less than 1 – then nothing prevents him to die.

Also I tried to check in prethink forward if user's health is <= 0 so it could be recovered, it didn't work though (player would die anyway).

EDIT: I don't mean to make a 'god mode', just want to prevent players to die in some situations.

Zenith77 10-06-2006 19:20

Re: 'controlling' damage taken
 
Hawk does this in his surf tools plugin; it's a multi-step process, you can follow what he does and when the time is right block the message or something like that.

commonbullet 10-06-2006 21:25

Re: 'controlling' damage taken
 
Thanks, I'll check that.

Hawk552 10-06-2006 22:00

Re: 'controlling' damage taken
 
I actually removed the section of code that does this, but anyway...

Set their HP to 1124 and then just throw your own damage. It makes it a lot easier.

Zenith77 10-06-2006 22:05

Re: 'controlling' damage taken
 
Any specific reason for setting their health to exactly 1124 or is that just a random number?

commonbullet 10-06-2006 22:14

Re: 'controlling' damage taken
 
Thank you. I guess it's the only way to make it, and it works as I expected. I have made that by adding 100 but I guess it's better with safer (higher) numbers.


All times are GMT -4. The time now is 04:50.

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