Raised This Month: $ Target: $400
 0% 

[HELP] Error Survivor Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abood alnjjar
Member
Join Date: Oct 2015
Location: palestine
Old 01-27-2016 , 13:14   [HELP] Error Survivor Damage
Reply With Quote #1

Hi Guys

i have Error compile this plugine plees help

PHP Code:
#include <amxmodx> 
#include <hamsandwich> 
#include <cs_ham_bots_api> 
#include <cstrike> 
#include <zombieplague>
#include <zp50_class_survivor> 
#include <zp50_grenade_frost>

new cvar_multiplier 

public plugin_init()  

    
register_plugin("[ZP] Survivor Damage Customizer""1.0""gogicaa"
     
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage_Post"1
    
RegisterHamBots(Ham_TakeDamage"fw_TakeDamage_Post"1
     
    
cvar_multiplier register_cvar("zp_survivor_damaga_multiplier""2.0"


public 
fw_TakeDamage_Post(victiminflictorattackerFloat:damagedamage_type

    if (
victim == attacker || !is_user_alive(attacker)) 
        return 
     
    if(
zp_class_survivor_get(attacker))
    
SetHamParamFloat (4damage get_pcvar_float(cvar_multiplier))
    
    
iDam[attacker] += damage get_pcvar_float(cvar_dmgmultiplier))

        if(
iDam[attacker] >= 2000)
}  
           
zp_grenade_frost_set(victim,true)
           
iDam[attacker] = 0
        
}
        
set_task(2.0"remove"victim)
}


public 
zp_fw_core_cure_post(id)
{
       if(
is_user_alive(id))
       {
           
iDam[id] = 0    
       
}
}

public 
zp_fw_core_infect_post(id)
{
       if(
is_user_alive(id))
       {
           
iDam[id] = 0    
       
}
}

public 
zp_fw_core_spawn_post(id)
{
       if(
is_user_alive(id))
       {
           
iDam[id] = 0    
       
}
}
       
public 
remove(id)
{
       if(
is_user_connected(id) && is_user_alive(id))
       {

       
zp_grenade_frost_set(idfalse)
       } 
__________________
abood alnjjar is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 01-27-2016 , 15:50   Re: [HELP] Error Survivor Damage
Reply With Quote #2

Bummer :\
I wonder how it could be fixed... maybe post the error?
redivcram is offline
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 01-27-2016 , 17:30   Re: [HELP] Error Survivor Damage
Reply With Quote #3

Show us the Error or line...
JoaoVieira is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-27-2016 , 20:36   Re: [HELP] Error Survivor Damage
Reply With Quote #4

I found the below issues that were giving compile errors. I fixed these things to make it compile without errors or warnings, but I did not check anything beyond that so I'm not sure if it works or not, that's your job. The bottom 2 bullets were not preventing compile but I added.
  • You were using the iDam[] variable without defining it. Since this holds a float, I renamed it to fDam[].
  • You were using the cvar_multiplier variable named incorrectly (cvar_dmgmultiplier) in takedamage.
  • Your opening/closing brackets were wrong.
  • Removed is_user_connected() check in remove() function because a connected check is done when you check is_user_alive().
  • Added remove_task() at client_disconnect().
PHP Code:

#include <amxmodx> 
#include <hamsandwich> 
#include <cs_ham_bots_api> 
#include <cstrike> 
#include <zombieplague>
#include <zp50_class_survivor> 
#include <zp50_grenade_frost>

#define MAX_PLAYERS    32

new Float:fDamMAX_PLAYERS ];

new 
cvar_multiplier 

public plugin_init()  

    
register_plugin"[ZP] Survivor Damage Customizer" "1.0" "gogicaa" 
    
    
RegisterHamHam_TakeDamage "player" "fw_TakeDamage_Post" true 
    
RegisterHamBotsHam_TakeDamage "fw_TakeDamage_Post" true 
    
    
cvar_multiplier register_cvar"zp_survivor_damaga_multiplier" "2.0" 


public 
fw_TakeDamage_Postvictim inflictor attacker Float:damage damage_type 

    if ( 
victim == attacker || !is_user_aliveattacker ) ) 
        return 
HAM_IGNORED
    
    
fDamattacker ] += damage get_pcvar_floatcvar_multiplier )
    
    if ( 
fDamattacker ] >= 2000.0 )
    { 
        
zp_grenade_frost_setvictim true )
        
fDamattacker ] = 0.0
        
        set_task
2.0 "remove" victim )
    }
    
    if( 
zp_class_survivor_get(attacker) )
    {
        
SetHamParamFloatdamage get_pcvar_floatcvar_multiplier ) )
        return 
HAM_HANDLED;
    }
    
    return 
HAM_IGNORED;


public 
client_disconnectid )
{
    
remove_taskid );
}

public 
zp_fw_core_cure_post(id)
{
    if(
is_user_alive(id))
    {
        
fDamid ] = 0.0    
    
}
}

public 
zp_fw_core_infect_post(id)
{
    if(
is_user_alive(id))
    {
        
fDamid ] = 0.0     
    
}
}

public 
zp_fw_core_spawn_post(id)
{
    if(
is_user_alive(id))
    {
        
fDamid ] = 0.0      
    
}
}
       
public 
removeid )
{
    if( 
is_user_aliveid ) )
    {
        
zp_grenade_frost_setid false )
    }

__________________

Last edited by Bugsy; 01-27-2016 at 21:16.
Bugsy is offline
abood alnjjar
Member
Join Date: Oct 2015
Location: palestine
Old 01-28-2016 , 09:45   Re: [HELP] Error Survivor Damage
Reply With Quote #5

thx is work
__________________
abood alnjjar 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:22.


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