AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to make a class of human damage to x2 knife? (https://forums.alliedmods.net/showthread.php?t=276728)

ADD47 12-27-2015 08:10

how to make a class of human damage to x2 knife?
 
I need help, probe many ways to do this but no work for me, if I could give it effective, thanks.

OciXCrom 12-27-2015 10:04

Re: how to make a class of human damage to x2 knife?
 
So, where's the code?

ADD47 12-27-2015 10:14

Re: how to make a class of human damage to x2 knife?
 
Quote:

Originally Posted by OciXCrom (Post 2376839)
So, where's the code?

PHP Code:

#include <amxmodx>
#include <zombieplague>
#include <fun>
#include <hamsandwich>

new boolg_knife[33]
new 
g_class_powerknife
new cvar_damage_multi

new const hclass4_name[] = ""
new const hclass4_info[] = ""
new const hclass4_model[] = ""
new const hclass4_clawmodel[] = ""
const hclass4_health 2600
const hclass4_speed 295
const Float:hclass4_gravity 0.7

public plugin_init()
{    
    
RegisterHamHam_TakeDamage"player""fw_TakeDamage" )
    
g_class_powerknife zp_register_human_class(hclass4_namehclass4_infohclass4_modelhclass4_clawmodelhclass4_healthhclass4_speedhclass4_gravity)
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if (!
is_user_connected(attacker))
        return 
HAM_IGNORED

    
if (g_knife[attacker])    
    {
        if (
get_user_weapon(attacker) == CSW_KNIFE)
        {
            
SetHamParamFloat(4damage 2.0)
        }
    } 
    return 
HAM_IGNORED;



siriusmd99 12-27-2015 17:56

Re: how to make a class of human damage to x2 knife?
 
Add "return HAM_HANDLED" after SetHamParam.

And make sure you assign g_knife[player] to true where needed.


All times are GMT -4. The time now is 17:58.

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