View Single Post
Old 09-15-2007, 02:32 AM   #11
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
The problem seems to be that the player actually takes the damage after the event, which is why we need to modify the damage. There must be a way, but it's not easy to know without documented function reference
Code:
function player_ondamage( player, damageinfo )
	player:AddHealth( damageinfo:GetDamage() )
end
With that I stay constantly at ~17 health when taking damage. Also it doesn't add armor back, and I have no idea how to detect how much armor was lost.

edit: could someone tell me how to create a variable of type "custom [float]"?

edit: Alright. If I do "SetDamage(0.0)" that "0.0" is actually considered as a "number" type variable which have precision of two decimals, but the precision of the damage is 12 decimals. How can I create a float that has precision of 12 decimals?

Last edited by A1win; 09-15-2007 at 04:22 AM.
A1win is offline   Reply With Quote