Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Enomine
Junior Member
Join Date: Apr 2012
Old 04-30-2012 , 14:18   Ham_TakeDamage doesn't work
Reply With Quote #1

I just want to make a no-kill server.
Code...
PHP Code:

//Init
    
RegisterHam(Ham_TakeDamage"player""HamTakeDamage"1);

public 
HamTakeDamage(thisidinflictoridattackerFloat:damagedamagebits)
{
    
SetHamParamFloat(40.0);
    return 
HAM_SUPERCEDE;


Last edited by Enomine; 04-30-2012 at 14:18.
Enomine is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 04-30-2012 , 14:19   Re: Ham_TakeDamage doesn't work
Reply With Quote #2

Chech is user alive(atacker)
__________________
kiki33hun is offline
Enomine
Junior Member
Join Date: Apr 2012
Old 04-30-2012 , 14:26   Re: Ham_TakeDamage doesn't work
Reply With Quote #3

Not working u,u
Enomine is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-30-2012 , 14:28   Re: Ham_TakeDamage doesn't work
Reply With Quote #4

SetHamParamFloat(damage, 0.0) i guess.
__________________

Last edited by Napoleon_be; 04-30-2012 at 14:28.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-30-2012 , 14:34   Re: Ham_TakeDamage doesn't work
Reply With Quote #5

You're hooking it as post.
hleV is offline
Enomine
Junior Member
Join Date: Apr 2012
Old 04-30-2012 , 15:06   Re: Ham_TakeDamage doesn't work
Reply With Quote #6

Thank you, works now.
Can you explain to me what is the diference to post 1 or 0.

Thanks.
Enomine is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-30-2012 , 15:49   Re: Ham_TakeDamage doesn't work
Reply With Quote #7

If you don't set post (use 0, hooking as pre), then it is before the event is fired.
If you do set post (use 1), then it is after the event is fired.

In this case, hooking post would be after damage is done, so you can no longer modify the damage value.
Hooking as pre will allow you to hook before damage is done so you can modify the values.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Enomine
Junior Member
Join Date: Apr 2012
Old 04-30-2012 , 15:58   Re: Ham_TakeDamage doesn't work
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
If you don't set post (use 0, hooking as pre), then it is before the event is fired.
If you do set post (use 1), then it is after the event is fired.

In this case, hooking post would be after damage is done, so you can no longer modify the damage value.
Hooking as pre will allow you to hook before damage is done so you can modify the values.
Thanks!
Enomine is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 04-30-2012 , 16:11   Re: Ham_TakeDamage doesn't work
Reply With Quote #9

Also, you can just return HAM_SUPERCEDE instead of set damage to 0 then return.

This code won't remove the blood, if you want to remove the blood (you said no-kill server), hook Ham_TraceAttack instead.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Enomine
Junior Member
Join Date: Apr 2012
Old 05-07-2012 , 08:36   Re: Ham_TakeDamage doesn't work
Reply With Quote #10

Quote:
Originally Posted by Devil259 View Post
Also, you can just return HAM_SUPERCEDE instead of set damage to 0 then return.

This code won't remove the blood, if you want to remove the blood (you said no-kill server), hook Ham_TraceAttack instead.
I've Hooked PostThink like a post, then when players shoots bullets doesn't hit the body

(Sorry for my bad english ^_^)

Thanks!
Enomine is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:43.


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