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

Subplugin Submission [ZP] Class: Chainsaw zombie


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
artos
Senior Member
Join Date: Mar 2010
Old 07-22-2011 , 07:17   [ZP] Class: Chainsaw zombie
Reply With Quote #1

[ZP] Chainsaw Zombie Class


This zombie class has a chainsaw instead of knife with custom sounds. Chainsaw causes double damage against humans.

If do you have any suggestions, bug reports etc. feel free to post.

Quote:
Changelog:
- 0.1 - First release
Quote:
Cvars:
zp_chainsaw_damage 2.0 - Makes double damage
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>

new const zclass_name[] = { "Chainsaw Zombie" 
new const 
zclass_info[] = { "Chainsaw Zombie Class" 
new const 
zclass_model[] = { "zombie_chainsaw" 
new const 
zclass_clawmodel[] = { "v_chainsaw.mdl" }
const 
zclass_health 1800 
const zclass_speed 190
const Float:zclass_gravity 1.0 
const Float:zclass_knockback 1.0 

new g_zclassid1

new cvar_damage;

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()
{
    
register_plugin("[ZP] Chainsaw Zombie Class""0.1""Artos")
    
    
register_forward(FM_EmitSound"fw_EmitSound");
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
cvar_damage register_cvar("zp_chainsaw_damage""2.0");
}

public 
plugin_precache()
{    
    
g_zclassid1 zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback

    for(new 
0sizeof chainsaw_soundsi++)
        
precache_sound(chainsaw_sounds[i])
}

public 
zp_user_infected_post(idinfector)
{
    if (
zp_get_user_zombie_class(id) == g_zclassid1)
        
client_print(idprint_chat"[ZP] You're using a chainsaw zombie class which have %s damage multiplier!"get_pcvar_float(cvar_damage))
}

public 
fw_EmitSound(idchannel, const sound[])
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id) || zp_get_user_survivor(id))
        return 
FMRES_IGNORED
        
    
for(new 0sizeof chainsaw_soundsi++)
    {
        if(
equal(soundknife_sounds[i]))
        {
            
emit_sound(idchannelchainsaw_sounds[i], 1.0ATTN_NORM0PITCH_NORM)
            return 
FMRES_SUPERCEDE
        
}
    }
            
    return 
FMRES_IGNORED
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if (
zp_get_user_nemesis(attacker) || !zp_get_user_zombie(attacker))
        return 
HAM_IGNORED;
    
    if (
get_user_weapon(attacker) != CSW_KNIFE)
        return 
HAM_IGNORED;
    
    if (
zp_get_user_zombie_class(attacker) == g_zclassid1)
    {
        
damage *= get_pcvar_float(cvar_damage)
        
SetHamParamFloat(4damage)
    }
    
    return 
HAM_SUPERCEDE

Attached Files
File Type: zip resources.zip (2.02 MB, 1802 views)
File Type: sma Get Plugin or Get Source (zp_chainsaw_zombie.sma - 2392 views - 2.9 KB)
__________________

Last edited by artos; 07-29-2011 at 14:28.
artos is offline
Send a message via Skype™ to artos
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 07-22-2011 , 09:05   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #2

PHP Code:
#include <zombieplague_old> 
to
PHP Code:
#include <zombieplague> 
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
artos
Senior Member
Join Date: Mar 2010
Old 07-22-2011 , 16:19   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #3

Quote:
Originally Posted by yokomo View Post
PHP Code:
#include <zombieplague_old> 
to
PHP Code:
#include <zombieplague> 
Oh sorry i'm using new natives with custom zp_register_zombie_class native and forgot to change it. Thanks.
__________________
artos is offline
Send a message via Skype™ to artos
Se7ven
Senior Member
Join Date: Feb 2011
Location: Romania
Old 07-27-2011 , 05:09   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #4

You just put in clasic zombie a new skin
And some sounds
Anyway nice work
__________________
WwW.HighCS.Ro From Romania For You
Se7ven is offline
Send a message via AIM to Se7ven Send a message via Yahoo to Se7ven
bibu
Veteran Member
Join Date: Sep 2010
Old 07-27-2011 , 13:57   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #5

Does the chainsaw sounds work at all?

PHP Code:
    if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id))
        return 
FMRES_IGNORED 
Should be changed to "!zp_get_user_zombie(id)" I think.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Gam3ronE
SourceMod Donor
Join Date: Aug 2010
Old 07-27-2011 , 16:44   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #6

Only 106 lines of code wow and it's a cool idea, very good job I might try this at some point in time.
Gam3ronE is offline
artos
Senior Member
Join Date: Mar 2010
Old 07-29-2011 , 14:29   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #7

Quote:
Originally Posted by bibu View Post
Does the chainsaw sounds work at all?

PHP Code:
    if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id))
        return 
FMRES_IGNORED 
Should be changed to "!zp_get_user_zombie(id)" I think.
Opss didn't saw this Thanks.

Fixed!
__________________
artos is offline
Send a message via Skype™ to artos
Secondry.
Junior Member
Join Date: Mar 2011
Location: Turkey/IstanbuL
Old 09-11-2011 , 21:01   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #8

Code:
#include <zombieplague>
Error ???
__________________
Amx Mod X - Assembler
Mail & Msn: Secondry[at]w.cn
Secondry. is offline
Send a message via MSN to Secondry.
artos
Senior Member
Join Date: Mar 2010
Old 09-13-2011 , 08:12   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #9

Quote:
Originally Posted by Secondry. View Post
Code:
#include <zombieplague>
Error ???
Make sure you have zombieplague.inc file.
__________________
artos is offline
Send a message via Skype™ to artos
mushelin
Member
Join Date: Sep 2011
Location: Shumen/Bulgaria
Old 01-25-2012 , 06:55   Re: [ZP] Class: Chainsaw zombie
Reply With Quote #10

Runtime error ?? I am runing ZP Advanced 1.6.1 server .. is the problem from that ?
mushelin is offline
Send a message via Skype™ to mushelin
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 05:34.


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