Raised This Month: $51 Target: $400
 12% 

FW_TakeDamage - Question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 03-02-2011 , 10:41   FW_TakeDamage - Question
Reply With Quote #1

PHP Code:
if (cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR || zp_get_user_nemesis(attacker)) 

      
set_nano_energy(victim0.0

I inserted this function in: public fw_takedamage(victim, inflictor, attacker, Float:damage, damagebits)

What I want is, that when the nemesis slash the victim, the victim to die immediately, not the energy to fall down to 0 and on the second hit to die.

PS: Nanosuit Advanced

Last edited by hellmoss; 03-04-2011 at 07:09.
hellmoss is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-02-2011 , 14:18   Re: FW_TakeDamage - Question
Reply With Quote #2

On any damage event handle attacker id and check if he is zombie. If true use this:

http://www.amxmodx.org/funcwiki.php?go=func&id=169

You can add manually frag to killer.
lis_16 is offline
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 03-03-2011 , 09:09   Re: FW_TakeDamage - Question
Reply With Quote #3

This is what happened: when the nemesis hit me i killed myself, and frags: -1, deaths: 1. And he did not score a frag.

That's what i did:
PHP Code:
    if (cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR || zp_get_user_nemesis(attacker) && !zp_get_user_zombie(attacker))
    {
        
user_kill (victim1)
        
set_nano_energy(victim0.0)
    } 
PS: I think i made a mistake?
hellmoss is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-03-2011 , 17:45   Re: FW_TakeDamage - Question
Reply With Quote #4

PHP Code:
   if (cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR || zp_get_user_nemesis(attacker) && !zp_get_user_zombie(attacker))
    {
        
user_kill (victim1)
        
set_user_frags(victimget_user_frags(victim)+1)
        
set_user_frags(attackerget_user_frags(attacker)+1)
        
set_nano_energy(victim0.0)
    } 
Try this. I told you do it manually.
lis_16 is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 03-03-2011 , 17:59   Re: FW_TakeDamage - Question
Reply With Quote #5

Quote:
Originally Posted by lis_16 View Post
PHP Code:
   if (cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR || zp_get_user_nemesis(attacker) && !zp_get_user_zombie(attacker))
    {
        
user_kill (victim1)
        
set_user_frags(victimget_user_frags(victim)+1)
        
set_user_frags(attackerget_user_frags(attacker)+1)
        
set_nano_energy(victim0.0)
    } 
Try this. I told you do it manually.
Why not just SetHamParamFloat(4, get_user_health(victim)) ?
Elusive138 is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-03-2011 , 18:36   Re: FW_TakeDamage - Question
Reply With Quote #6

I told on any damage event so it musn't be hamsandwich methode, but the way you are talking about is good- will kill instantly and give frag to killer.
lis_16 is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 03-03-2011 , 20:25   Re: FW_TakeDamage - Question
Reply With Quote #7

Quote:
Originally Posted by lis_16 View Post
I told on any damage event so it musn't be hamsandwich methode, but the way you are talking about is good- will kill instantly and give frag to killer.
I was under the impression that TakeDamage was a Hamsandwich forward, but if it isn't then that method would not work.
Elusive138 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-03-2011 , 20:56   Re: FW_TakeDamage - Question
Reply With Quote #8

Quote:
Originally Posted by Elusive138 View Post
Why not just SetHamParamFloat(4, get_user_health(victim)) ?
You would need to float that value. Also, this might not work properly if the player has armor.

Quote:
Originally Posted by lis_16 View Post
I told on any damage event so it musn't be hamsandwich methode, but the way you are talking about is good- will kill instantly and give frag to killer.
The function header in the first post indicates it is a HamSandwich hook for TakeDamage.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 03-04-2011 , 07:08   Re: FW_TakeDamage - Question
Reply With Quote #9

Quote:
Originally Posted by lis_16 View Post
PHP Code:
   if (cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR || zp_get_user_nemesis(attacker) && !zp_get_user_zombie(attacker))
    {
        
user_kill (victim1)
        
set_user_frags(victimget_user_frags(victim)+1)
        
set_user_frags(attackerget_user_frags(attacker)+1)
        
set_nano_energy(victim0.0)
    } 
Try this. I told you do it manually.
Why should I do it manually? I just want the nemesis to take all the energy that the Nanosuit has and all the health with one hit. And the nemesis to make a frag and the player to die (+1 to death and +0 to frags). Just like normal fragging and to announce here: .

Besides, here's what happens in-game with the code you gave me:
1. When I'm on armor mode, if I jump from a high place no matter how high, just enough to take me hp I die immediately.

2. If a nemesis attacks me I commit suicide and no frags added to nemesis and -1 to frags and 1 to deaths added to me.
----------------------------------------------------------
Not to mention the debug trace:
Code:
L 03/04/2011 - 13:47:47: [FUN] Player out of range (0)
L 03/04/2011 - 13:47:47: [AMXX] Displaying debug trace (plugin "nanosuit_advanced.amxx")
L 03/04/2011 - 13:47:47: [AMXX] Run time error 10: native error (native "set_user_frags")
L 03/04/2011 - 13:47:47: [AMXX]    [0] nanosuit_advanced.sma::fw_takedamage (line 1777)
Line 1777 is:
Code:
    if (zp_get_user_nemesis(attacker) && !zp_get_user_zombie(attacker) || cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR)
    {
        user_kill (victim, 1)
        set_user_frags(victim, get_user_frags(victim)+1)
        set_user_frags(attacker, get_user_frags(attacker)+1)
        set_nano_energy(victim, 0.0)
    }


Last edited by hellmoss; 03-04-2011 at 07:15.
hellmoss is offline
lis_16
Senior Member
Join Date: Feb 2008
Old 03-04-2011 , 09:01   Re: FW_TakeDamage - Question
Reply With Quote #10

PHP Code:
if (zp_get_user_zombie(attacker) && cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR || zp_get_user_nemesis(attacker)) 

      
set_nano_energy(victim0.0
         
SetHamParamFloat(4roundfloat(get_user_health(victim)))

Try this. You can replace zp_get_user_zombie to zp_get_user_nemesis.
lis_16 is offline
Reply



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 15:17.


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