Raised This Month: $ Target: $400
 0% 

disinfect chance.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fucked_up_kid
Junior Member
Join Date: Apr 2012
Old 07-13-2012 , 14:10   disinfect chance.
Reply With Quote #1

i need code to when human shoot zombie there is chance to disinfect him !
i try this but error when i jump and loose health.

Code:
L 07/14/2012 - 20:01:49: Info (map "de_dust") (file "addons/amxmodx/logs/error_20120714.log")
L 07/14/2012 - 20:01:49: [ZP] Invalid Player (0)
L 07/14/2012 - 20:01:49: [AMXX] Displaying debug trace (plugin "zp_main_class_human_medic.amxx")
L 07/14/2012 - 20:01:49: [AMXX] Run time error 10: native error (native "zp_class_human_get_current")
L 07/14/2012 - 20:01:49: [AMXX]    [0] zp_main_class_human_medic.sma::fw_TakeDamage (line 35)
Code:
public fw_TakeDamage(victim, attacker)
{
    if(attacker==victim)
        return
    
    if(zp_class_human_get_current(attacker) == human_medic ) 
    { 
        if(!zp_core_is_zombie(attacker) && zp_class_nemesis_get(victim) && !is_user_bot(victim))  
        {  
            if(random_num(1,100) <= 5)
            {
                zp_core_cure(victim)
            }
                    
        } 
    }
}
please help ! sorry my english . i use translator.
fucked_up_kid is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-13-2012 , 17:57   Re: disinfect chance.
Reply With Quote #2

You need to check if attacker is alive.

Like this.
PHP Code:
if(is_user_alive(attacker)) {
       
// Blabla...

__________________
H.RED.ZONE is offline
fucked_up_kid
Junior Member
Join Date: Apr 2012
Old 07-14-2012 , 04:19   Re: disinfect chance.
Reply With Quote #3

ok.
but this part is coded good ? i cant test bots.

Code:
public fw_TakeDamage(victim, attacker)
{
    if(attacker==victim)
        return
    
    if(zp_class_human_get_current(attacker) == human_medic ) 
    { 
        if(!zp_core_is_zombie(attacker) && zp_class_nemesis_get(victim) && !is_user_bot(victim))  
        {  
            if(random_num(1,100) <= 5)
            {
                zp_core_cure(victim)
            }
                    
        } 
    }
}

Last edited by fucked_up_kid; 07-14-2012 at 04:19.
fucked_up_kid is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-14-2012 , 05:22   Re: disinfect chance.
Reply With Quote #4

Yes it will work but why
Code:
zp_class_nemesis_get(victim)
That will make only "Nemesis" human.

In other case if you set

Code:
!zp_class_nemesis_get(victim)
That will not include "Nemesis" and will only include "Zombies".
__________________
H.RED.ZONE is offline
fucked_up_kid
Junior Member
Join Date: Apr 2012
Old 07-14-2012 , 05:51   Re: disinfect chance.
Reply With Quote #5

thanks . thet is mistake.
and if i use zp_core_cure(victim) if zombie is last it turn him in human ?
fucked_up_kid 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 09:04.


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