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

Help me with this zombie class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FitnessMan
Junior Member
Join Date: Oct 2014
Old 04-22-2015 , 17:06   Help me with this zombie class
Reply With Quote #1

Make me in this zombie class , sound for knife,only for this class.Take help from https://forums.alliedmods.net/showthread.php?t=162726

Code:
#include <amxmodx> 
 #include <hamsandwich> 
 #include <basebuilder> 

 new witch_dmg; 
 new mp; 
 new g_zclass14; 

 new const zclass14_name[] = { "Strong Zombie" } 
 new const zclass14_info[] = { "\y[\rDamage\y] \yx2" } 
 new const zclass14_model[] = { "bb_zmstrong" } 
 new const zclass14_clawmodel[] = { "v_zmstrong" } 
 const zclass14_health = 4000 
 const zclass14_speed = 360 
 const Float:zclass14_gravity = 0.7 
 const Float:zclass14_knockback = 0.9 
 const zclass_adminflags = ADMIN_RESERVATION 

 public plugin_init() 
 { 
    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage"); 
    witch_dmg = register_cvar("zp_witch_damage", "2"); 
    mp = get_maxplayers(); 
 } 
 public plugin_precache() 
 { 
    register_plugin("[BB] Default Zombie Classes", "6.5", "Tirant") 
    g_zclass14 = zp_register_zombie_class(zclass14_name, zclass14_info, zclass14_model, zclass14_clawmodel, zclass14_health, zclass14_speed, zclass14_gravity,0.0, zclass_adminflags); 
 } 

 public fw_TakeDamage(victim, inflictor, attacker, Float:damage, dmgbits) 
 { 
    if(attacker < 1 || attacker > mp) 
       return HAM_IGNORED; 
    if(!is_user_alive(attacker) 
       return HAM_IGNORED; 
    if(!bb_is_user_zombie(attacker)) 
       return HAM_IGNORED; 
    if(get_user_weapon(attacker) != CSW_KNIFE) 
       return HAM_IGNORED; 
    if(bb_get_user_zombie_class(attacker) != g_zclass14) 
       return HAM_IGNORED; 
     
    SetHamParamFloat(4, damage*get_pcvar_float(witch_dmg)); 
    return HAM_IGNORED; 
 }
FitnessMan is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-22-2015 , 17:52   Re: Help me with this zombie class
Reply With Quote #2

try

Code:
#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich> 
#include <basebuilder> 

 new witch_dmg; 
 new mp; 
 new g_zclass14; 

 new const zclass14_name[] = { "Strong Zombie" } 
 new const zclass14_info[] = { "\y[\rDamage\y] \yx2" } 
 new const zclass14_model[] = { "bb_zmstrong" } 
 new const zclass14_clawmodel[] = { "v_zmstrong" } 
 const zclass14_health = 4000 
 const zclass14_speed = 360 
 const Float:zclass14_gravity = 0.7 
 const Float:zclass14_knockback = 0.9 
 const zclass_adminflags = ADMIN_RESERVATION 
 
 new const chainsaw_sounds[][] =
{
        "zombie_plague/chainsaw2_miss.wav",
        "zombie_plague/chainsaw1_miss.wav",
        "zombie_plague/chainsaw2_miss.wav",
        "zombie_plague/chainsaw1_hit.wav",
        "zombie_plague/chainsaw2_hit.wav",
        "zombie_plague/chainsaw1_hit.wav",
        "zombie_plague/chainsaw1_miss.wav",
        "zombie_plague/chainsaw2_miss.wav",
        "zombie_plague/chainsaw1_hit.wav"
}

new const knife_sounds[][] =
{
    "weapons/knife_deploy1.wav",
    "weapons/knife_hit1.wav",
    "weapons/knife_hit2.wav",
    "weapons/knife_hit3.wav",
    "weapons/knife_hit4.wav",
    "weapons/knife_hitwall1.wav",
    "weapons/knife_slash1.wav",
    "weapons/knife_slash2.wav",
    "weapons/knife_stab.wav"
} 

 public plugin_init() 
 { 
    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage"); 
    register_forward(FM_EmitSound, "fw_EmitSound"); 
    witch_dmg = register_cvar("zp_witch_damage", "2"); 
    mp = get_maxplayers(); 
 } 
 public plugin_precache() 
 { 
    register_plugin("[BB] Default Zombie Classes", "6.5", "Tirant") 
    g_zclass14 = zp_register_zombie_class(zclass14_name, zclass14_info, zclass14_model, zclass14_clawmodel, zclass14_health, zclass14_speed, zclass14_gravity,0.0, zclass_adminflags); 
    for(new i = 0; i < sizeof chainsaw_sounds; i++)
        precache_sound(chainsaw_sounds[i]) 
 } 

 public fw_EmitSound(id, channel, const sound[])
 {
    if(!is_user_alive(id) || !zp_get_user_zombie(id) || zp_get_user_survivor(id))
        return FMRES_IGNORED
    if(if(bb_get_user_zombie_class(id) != g_zclass14) 
        return FMRES_IGNORED
        
    for(new i = 0; i < sizeof chainsaw_sounds; i++)
    {
        if(equal(sound, knife_sounds[i]))
        {
            emit_sound(id, channel, chainsaw_sounds[i], 1.0, ATTN_NORM, 0, PITCH_NORM)
            return FMRES_SUPERCEDE
        }
    }
            
    return FMRES_IGNORED
 } 
 public fw_TakeDamage(victim, inflictor, attacker, Float:damage, dmgbits) 
 { 
    if(attacker < 1 || attacker > mp) 
       return HAM_IGNORED; 
    if(!is_user_alive(attacker) 
       return HAM_IGNORED; 
    if(!bb_is_user_zombie(attacker)) 
       return HAM_IGNORED; 
    if(get_user_weapon(attacker) != CSW_KNIFE) 
       return HAM_IGNORED; 
    if(bb_get_user_zombie_class(attacker) != g_zclass14) 
       return HAM_IGNORED; 
     
    SetHamParamFloat(4, damage*get_pcvar_float(witch_dmg)); 
    return HAM_IGNORED; 
 }

Last edited by Depresie; 04-23-2015 at 08:38.
Depresie is offline
FitnessMan
Junior Member
Join Date: Oct 2014
Old 04-22-2015 , 18:11   Re: Help me with this zombie class
Reply With Quote #3

All zombe's is have this sound's.. im need only this zombie have.
FitnessMan is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-22-2015 , 18:15   Re: Help me with this zombie class
Reply With Quote #4

i updated the code above, try
Depresie is offline
FitnessMan
Junior Member
Join Date: Oct 2014
Old 04-23-2015 , 08:14   Re: Help me with this zombie class
Reply With Quote #5

Error: Undefined symbol "attacker" on line 65
FitnessMan is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-23-2015 , 08:38   Re: Help me with this zombie class
Reply With Quote #6

updated
Depresie is offline
FitnessMan
Junior Member
Join Date: Oct 2014
Old 04-23-2015 , 08:51   Re: Help me with this zombie class
Reply With Quote #7

Thenks you !
FitnessMan is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-23-2015 , 09:05   Re: Help me with this zombie class
Reply With Quote #8

np, anytime, btw next time post it in the zombie plague section
Depresie is offline
FitnessMan
Junior Member
Join Date: Oct 2014
Old 04-23-2015 , 11:44   Re: Help me with this zombie class
Reply With Quote #9

Hey man please help me with this,im make 1 new class and show this error
Error: Number of arguments does not match definition on line 27
zClassId = zp_register_zombie_class(zname, zinfo, zmodel, zclawmodel, zhealth, zspeed, zgravity, zknockback, zadminflags)

Sorry for my english
FitnessMan is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-23-2015 , 15:21   Re: Help me with this zombie class
Reply With Quote #10

post full .sma
Depresie 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 22:10.


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