Thread: [Subplugin Submission] [ZP] List of VIP Extra Items
View Single Post
Light_Dark
Member
Join Date: Jul 2013
Old 08-31-2014 , 07:24   Re: [ZP] VIP Extra Items (8/8/2014)
Reply With Quote #19

Convert Them into Zp vip zombie classes
i use zp5.0 please
PHP Code:
/*================================================================================

-----------------------------------
-*- [ZP] Hunter L4D -*-
-----------------------------------

~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~

This zombie has long jumps as well as the popular game L4D2
Well, this time the skill is good and better,
to jump you have to press Ctrl + E and look where you want to jump.

================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

/*================================================================================
[Customizations]
=================================================================================*/

// Zombie Attributes
new const zclass_name[] = "Hunter L4D2"
new const zclass_info[] = "You can do super jumps"
new const zclass_model[] = "hunterv2_zp"
new const zclass_clawmodel[] = "v_knife_zombie_hunter.mdl"

const zclass_health 710
const zclass_speed 290

const Float:zclass_gravity 0.6
const Float:zclass_knockback 1.0

new const leap_sound[4][] = { "left_4_dead2/hunter_jump.wav""left_4_dead2/hunter_jump1.wav""left_4_dead2/hunter_jump2.wav""left_4_dead2/hunter_jump3.wav" }

/*================================================================================
Customization ends here!
Any edits will be your responsibility
=================================================================================*/

// Variables
new g_hunter

// Arrays
new Float:g_lastleaptime[33]

// Cvar pointers
new cvar_forcecvar_cooldown

// Plugin info.
#define PLUG_VERSION "0.2"
#define PLUG_AUTHOR "DJHD!"

/*================================================================================
[Init, CFG and Precache]
=================================================================================*/

public plugin_precache()
{
    
// Register the new class and store ID for reference
    
g_hunter zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
    
    
// Sound
    
static i
    
for(0sizeof leap_soundi++)
        
precache_sound(leap_sound[i])
}

public 
plugin_init() 
{
    
// Plugin Info
    
register_plugin("[ZP] Zombie Class: Hunter L4D2 Zombie"PLUG_VERSIONPLUG_AUTHOR)
    
    
// Forward
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink"
    
    
// Cvars
    
cvar_force register_cvar("zp_hunter_jump_force""890"
    
cvar_cooldown register_cvar("zp_hunter_jump_cooldown""1.0")
    
    static 
szCvar[30]
    
formatex(szCvarcharsmax(szCvar), "v%s by %s"PLUG_VERSIONPLUG_AUTHOR)
    
register_cvar("zp_zclass_hunterl4d2"szCvarFCVAR_SERVER|FCVAR_SPONLY)
}

/*================================================================================
[Zombie Plague Forwards]
=================================================================================*/

public zp_user_infected_post(idinfector)
{
    
// It's the selected zombie class
    
if(zp_get_user_zombie_class(id) == g_hunter)
    {
        if(
zp_get_user_nemesis(id))
            return
        
        
// Message
        
client_print(idprint_chat"[ZP] To use the super jump ability press - ^"CTRL E^"")
    }
}

/*================================================================================
[Main Forwards]
=================================================================================*/

public fw_PlayerPreThink(id)
{
    if(!
is_user_alive(id))
        return
        
    if(
zp_get_user_nemesis(id))
        return
    
    if(
is_user_connected(id))
    {
        if (
allowed_hunterjump(id))
        {
            static 
Float:velocity[3]
            
velocity_by_aim(idget_pcvar_num(cvar_force), velocity)
            
set_pev(idpev_velocityvelocity)
            
            
emit_sound(idCHAN_STREAMleap_sound[random_num(0sizeof leap_sound -1)], 1.0ATTN_NORM0PITCH_HIGH)
            
            
// Set the current super jump time
            
g_lastleaptime[id] = get_gametime()
        }
    }
}

/*================================================================================
[Internal Functions]
=================================================================================*/

allowed_hunterjump(id)
{    
    if (!
zp_get_user_zombie(id) && zp_get_user_nemesis(id))
        return 
false
    
    
if (zp_get_user_zombie_class(id) != g_hunter)
        return 
false
    
    
if (!((pev(idpev_flags) & FL_ONGROUND) && (pev(idpev_flags) & FL_DUCKING)))
        return 
false
    
    
static buttons
    buttons 
pev(idpev_button)
    
    
// Not doing a longjump (added bot support)
    
if (!(buttons IN_USE) && !is_user_bot(id))
        return 
false
    
    
static Float:cooldown
    cooldown 
get_pcvar_float(cvar_cooldown)
    
    if (
get_gametime() - g_lastleaptime[id] < cooldown)
        return 
false
    
    
return true

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>
#include <fakemeta>
/*        WereWolf Zombie
            by x[L]eoNNN
        
        #Description :
        
        this is a Zombie Class of Famous Game, "L4d" with the ability to throw rocks at enemies,
        either killing him, infecting taking life, etc. (controlled by a cvar)
        
        this is a Zombie Class that is Werewolf, alone which can be killed by silver bullets
        that are bought extra item
        
        #Cvars :
        
        zp_sb_oneround 1 // one round bullets
        zp_silver_bullets 30 // silver bullets
        zp_werewolf_killreward_enable 1 // 1 = enable ammo packs reward / 0 = disable
        zp_werewolf_killreward  4 // ammo packs reward for kill a werewolf
        zp_sb_effect 1 // silver bullets effect
        zp_werewolf_howling 1 // enable werewolf howling
        zp_werewolf_howling_time 5.0 // werewolf howling time
        zp_werewolf_howling_dontmove 1 // dont move in howling
        
        #Changelog :
        
        v1.0: public release

*/
new const zclass_name[] = { "WereWolf" // name
new const zclass_info[] = { "Only it can be killed by silver bullets" // description
new const zclass_model[] = { "zm_werewolf" // model
new const zclass_clawmodel[] = { "v_werewolf.mdl" // claw model
const zclass_health 800 // health
const zclass_speed 200 // speed
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 0.6 // knockback

new const howling_sounds[][] = { "zm_werewolf/werewolf1.wav""zm_werewolf/werewolf2.wav" }
new const 
silver_bullets_sprite[] = "sprites/dot.spr" // silver bullets sprite

new cvar_oneroundcvar_sbcvar_rewardenablecvar_rewardcvar_sb_effectcvar_howlingcvar_dontmove,
cvar_howlingtimecvar_lasthowlingcvar_damage

new g_SBItemIDg_SBSprg_werewolf
new boolg_PlayerHaveSB[33], g_SilverBullets[33]
new 
Float:g_last_howling[33]

public 
plugin_init()
{
    
register_plugin("[ZP] Zombie Class: Werewolf Zombie""1.0""xLeoNNN"
    
register_event("CurWeapon""event_CurWeapon""be""1=1""3>0")
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
register_forward(FM_CmdStart"CmdStart" )
    
    
g_SBItemID zp_register_extra_item("Buy Silver Bullets"15ZP_TEAM_HUMAN)
    
    
cvar_oneround register_cvar("zp_sb_oneround""1")
    
cvar_sb register_cvar("zp_silver_bullets""30")
    
cvar_rewardenable register_cvar("zp_werewolf_killreward_enable""1")
    
cvar_reward register_cvar("zp_werewolf_killreward""4")
    
cvar_sb_effect register_cvar("zp_sb_effect""1")
    
cvar_howling register_cvar("zp_werewolf_howling""1")
    
cvar_howlingtime register_cvar("zp_werewolf_howling_time""5.0")
    
cvar_dontmove register_cvar("zp_werewolf_howling_dontmove""1")
    
cvar_lasthowling register_cvar"zp_werewolf_last_howling_time""20.0" )
    
cvar_damage register_cvar("zp_werewolf_damage","0.5")
}

public 
plugin_precache()
{
    
g_werewolf zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback
    
g_SBSpr precache_model(silver_bullets_sprite)
    static 
i
    
for(0sizeof howling_soundsi++)
        
precache_sound(howling_sounds[i])
}


public 
zp_user_infected_post idinfector )
{
    if (
zp_get_user_zombie_class(id) == g_werewolf)
    {
        
print_chatColor(id"\g[ZP]\n You have choosen \gWereWolf\n, only you can be killed by silver bullets!!"
    }
    
g_PlayerHaveSB[id] = false
    g_SilverBullets
[id] = false
}  

public 
zp_user_humanized_post(id)
{
    
g_PlayerHaveSB[id] = false
    g_SilverBullets
[id] = false
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid == g_SBItemID)
    {
        
print_chatColor(id"\g[ZP]\n You have bought silver bullets, now you can kill a \gwerewolf\n!!!")
        
g_PlayerHaveSB[id] = true
        g_SilverBullets
[id] = get_pcvar_num(cvar_sb)
    }
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    
g_PlayerHaveSB[victim] = false
    g_SilverBullets
[victim] = false
    
    
if(g_PlayerHaveSB[attacker] && zp_get_user_zombie_class(victim) == g_werewolf)
    {
        if(
get_pcvar_num(cvar_rewardenable))
        {
            
print_chatColor(attacker"\g[ZP]\n You Receive \t%d\n Ammo Packs To Kill a WereWolf!"get_pcvar_num(cvar_reward))
            
zp_set_user_ammo_packs(attackerzp_get_user_ammo_packs(attacker) + get_pcvar_num(cvar_reward))
        }
    }    
}

public 
client_connect(id)
{
    
g_PlayerHaveSB[id] = false
    g_SilverBullets
[id] = false
}

public 
client_disconnect(id)
{
    
g_PlayerHaveSB[id] = false
    g_SilverBullets
[id] = false
}

public 
fw_PlayerSpawn_Post(id)
{
    if (!
is_user_alive(id))
        return;
    
    if(
get_pcvar_num(cvar_oneround))
    {
        
g_PlayerHaveSB[id] = false
        g_SilverBullets
[id] = false
    
}
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if(!
g_PlayerHaveSB[attacker] && zp_get_user_zombie_class(victim) == g_werewolf)
    {
        new 
Floatdmg;
        
        
dmg get_pcvar_float(cvar_damage)
        
        
SetHamParamFloat(4damage*dmg)
        return 
HAM_SUPERCEDE
    
}
    else
        if(
get_user_weapon(attacker) == CSW_KNIFE)
            if(
zp_get_user_zombie_class(victim) == g_werewolf)
                return 
HAM_SUPERCEDE
    
    
return HAM_IGNORED
}

public 
CmdStart( const id, const uc_handlerandom_seed )
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    if(!
zp_get_user_zombie(id) || zp_get_user_nemesis(id))
        return 
FMRES_IGNORED;
    
    new 
button pev(idpev_button)
    new 
oldbutton pev(idpev_oldbuttons)
    
    if (
zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_werewolf)
    {
        if(
oldbutton IN_RELOAD && !(button IN_RELOAD))
        {
            if( 
get_gametime() - g_last_howling[id] < get_pcvar_float(cvar_lasthowling))
            {
                
print_chatColor(id"\g[ZP]\n You need to wait for %.f0 seconds to howling again!"get_pcvar_float(cvar_lasthowling) - (get_gametime() - g_last_howling[id]))
                return 
PLUGIN_HANDLED
            
}
            
            
g_last_howling[id] = get_gametime()
            
            if(
get_pcvar_num(cvar_howling))
            {
                
emit_sound(idCHAN_STREAMhowling_sounds[random_num(0sizeof howling_sounds 1)], 1.0ATTN_NORM0PITCH_HIGH )
                if(
get_pcvar_num(cvar_dontmove))
                {
                    
set_pev(id pev_velocity , { 0.0 0.0 0.0 } )
                    
set_pev(idpev_flagspev(idpev_flags) | FL_FROZEN
                    
set_task(get_pcvar_float(cvar_howlingtime), "set_vel"id)
                }
            }
        }
    }
    return 
FMRES_IGNORED
}

public 
set_vel(id)
    
set_pev(id pev_flags pev(id pev_flags) & ~FL_FROZEN)

public 
event_CurWeapon(id)
{
    new 
buttons pev(idpev_button)
    new 
oldbuttons pev(idpev_oldbuttons)
    
    if(
buttons IN_ATTACK || oldbuttons IN_ATTACK)
    {
        if (
g_SilverBullets[id] > && g_PlayerHaveSB[id] ) 
        {
            if(
get_pcvar_num(cvar_sb_effect))
            {
                static 
Origin[3], Origin2[3]
                
get_user_origin(idOrigin1
                
get_user_origin(idOrigin24
                
                
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
                
write_byte (0)     
                
write_coord(Origin[0])
                
write_coord(Origin[1])
                
write_coord(Origin[2])
                
write_coord(Origin2[0])
                
write_coord(Origin2[1])
                
write_coord(Origin2[2])
                
write_short(g_SBSpr)
                
write_byte(1
                
write_byte(5
                
write_byte(2
                
write_byte(10
                
write_byte(0
                
write_byte(132)     
                
write_byte(132)       
                
write_byte(132)
                
write_byte(200
                
write_byte(150
                
message_end()
            }
            
            
g_SilverBullets[id]--
        }
    }
    if(
g_SilverBullets[id] <= 0)
    {
        
g_PlayerHaveSB[id] = false
        g_SilverBullets
[id] = 0
    
}
}


stock print_chatColor(const id,const input[], any:...)
{
    new 
msg[191], players[32], count 1;
    
vformat(msg,190,input,3);
    
replace_all(msg,190,"\g","^4");// green
    
replace_all(msg,190,"\n","^1");// normal
    
replace_all(msg,190,"\t","^3");// team
    
    
if (idplayers[0] = id; else get_players(players,count,"ch");
    for (new 
i=0;i<count;i++)
        if (
is_user_connected(players[i]))
    {
        
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
        
write_byte(players[i]);
        
write_string(msg);
        
message_end();
    }
}  
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/ 
Light_Dark is offline