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

Help / Support [Help] Hunter Admin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Andreita
BANNED
Join Date: Apr 2012
Old 04-12-2012 , 13:35   [Help] Hunter Admin
Reply With Quote #1

hi my Name is Andrea , Someone Can help me to maake Admin Hunter (Zombie Class).. Please ? u__u

This is My hunter SMA :
PHP Code:
/*
*    ---------------------------------------------------------------------------------------------------------
*    ------------------------------------[ZP] Zombie Class: Hunter--------------------------------------------
*    ---------------------------------------------------------------------------------------------------------
*    --------------------------------Author: SNAKER_BEATTER + ORIGINALLY BY DJHD!-----------------------------
*    ---------------------------------------------------------------------------------------------------------
*                About:
*        Well this is not by me, this is originally by DJHD!.
*        When i tested hes original hunter if you're a human you can do super jump and if nemesis and 
*        survivor too and thats is i  fixed at this plugin...
*    ---------------------------------------------------------------------------------------------------------
*                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...
*    ---------------------------------------------------------------------------------------------------------
*                Credits:
*        DJHD! - Originally post by him
*    ---------------------------------------------------------------------------------------------------------
*                Cvars:
*        zp_hunter_jump_cooldown // After used cooldown starts. default=1.0 or 1
*        zp_hunter_jump_force // How high hunter's jump do?. default=890 (higher than nemesis's leap)
*        zp_zclass_hunterl4d2 // Show hunter's version and author at console
*    ----------------------------------------------------------------------------------------------------------
*                Modules:
*        fakemeta
*    -----------------------------------------------------------------------------------------------------------
*                Change log:
*        0.2a (Oct 1, 2011)
*        {
*            0.2 originally posted by DJHD!
*            Fix smoker is not zombie he can do super jump
*        }
*/

/******************************************************
        [Include files]
******************************************************/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <amxmisc>
#include <zp50_class_zombie>

/******************************************************
        [Plugin infos]
******************************************************/

#define PLUGIN_NAME "[ZP] ZCLASS: Hunter zombie"
#define PLUGIN_VERSION "0.2a"
#define PLUGIN_AUTHOR "DJHD!+snaker beatter"

/******************************************************
        [Id(s)]
******************************************************/

new class_id

public plugin_precache()
{
    
register_plugin("Admin only class","1.0","Sp@jk")
    
class_id zp_class_zombie_register("Admin Zombie","Only admins can use!",5000,300.0,0.5)
}

public 
zp_fw_class_zombie_select_pre(id,cid)
{
    if( 
cid==class_id )
    {
        if(!
is_user_admin(id))
            return 
ZP_CLASS_NOT_AVAILABLE
    
}
    return 
ZP_CLASS_AVAILABLE


// Zombie Attributes
new const zclass_name[] = "Hunter L4D2"
new const zclass_info[] = "Puedes Brincar"
new const zclass_model[] = { "hunterv2_zp" }
new const 
zclass_clawmodel[] = { "v_knife_zombie_hunter.mdl" }
const 
zclass_speed 290
const zclass_health 710
const Float:zclass_gravity 0.6
const Float:zclass_knockback 1.2
// Sounds
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" }
// Variables
new g_hunterbool:g_b_isJumper[33]
// Arrays
new Float:g_lastleaptime[33]
// Cvar pointers
new cvar_forcecvar_cooldown

/******************************************************
        [Main events] + [Precache event]
******************************************************/

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(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_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"PLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar("zp_zclass_hunterl4d2"szCvarFCVAR_SERVER|FCVAR_SPONLY)
}

/******************************************************
        [Events]
******************************************************/

public zp_user_infected_post(idinfector// Infected post
{
    
// 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^"")
    }
}

public 
fw_PlayerPreThink(id// Main hunter command
{
    if(!
zp_get_user_zombie(id))
    {
        
false_g_b_is_Jumper(id)
        return 
    }
    
    if(!
is_user_alive(id))
    {
        
false_g_b_is_Jumper(id)
        return
    }
    
    if (
zp_get_user_survivor(id))
    {
        
false_g_b_is_Jumper(id)
        return
    }
    
    if (
zp_get_user_nemesis(id))
    {
        
false_g_b_is_Jumper(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)
            
            
g_b_isJumper[id] = true
            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()
        }
    }
}

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


public 
false_g_b_is_Jumper(id// Remove super jumps to  human/survivor/nemesis
{
    
g_b_isJumper[id] = false

Andreita is offline
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 04-12-2012 , 15:02   Re: [Help] Hunter Admin
Reply With Quote #2

You mean only admin can choose hunter class right?
__________________
naSTR is offline
Andreita
BANNED
Join Date: Apr 2012
Old 04-12-2012 , 15:11   Re: [Help] Hunter Admin
Reply With Quote #3

Yea , Only admin Use the Hunter class
Andreita is offline
Heyka
Member
Join Date: Mar 2012
Old 04-12-2012 , 16:18   Re: [Help] Hunter Admin
Reply With Quote #4

What version of Zombie Plague?
Heyka is offline
Andreita
BANNED
Join Date: Apr 2012
Old 04-12-2012 , 16:36   Re: [Help] Hunter Admin
Reply With Quote #5

I have 5.8 Zombie Plague But its the same 5.0/5.8 no?
Andreita is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 04-12-2012 , 16:39   Re: [Help] Hunter Admin
Reply With Quote #6

Read this...
http://forums.alliedmods.net/showthread.php?t=165450
__________________
H.RED.ZONE is offline
Andreita
BANNED
Join Date: Apr 2012
Old 04-12-2012 , 16:50   Re: [Help] Hunter Admin
Reply With Quote #7

i did , But i cant Uderstand .. :S!
Andreita is offline
AmineKyo
فوق سريرك
Join Date: Oct 2011
Location: Morocco
Old 04-12-2012 , 18:15   Re: [Help] Hunter Admin
Reply With Quote #8

Try this :
PHP Code:
/******************************************************
        [Include files]
******************************************************/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>
#include <zp50_class_zombie>

/******************************************************
        [Plugin infos]
******************************************************/

#define PLUGIN_NAME "[ZP] ZCLASS: Hunter zombie"
#define PLUGIN_VERSION "0.2b"
#define PLUGIN_AUTHOR "DJHD!+snaker beatter"

/******************************************************
        [Id(s)]
******************************************************/

// 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_speed 290
const zclass_health 710
const Float:zclass_gravity 0.6
const Float:zclass_knockback 1.2
// Sounds
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" }
// Variables
new g_hunterbool:g_b_isJumper[33]
// Arrays
new Float:g_lastleaptime[33]
// Cvar pointers
new cvar_forcecvar_cooldown

/******************************************************
        [Main events] + [Precache event]
******************************************************/

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 
zp_fw_class_zombie_select_pre(id,cid)
{
    if( 
cid==g_hunter )
    {
        if(!
is_user_admin(id))
            return 
ZP_CLASS_NOT_AVAILABLE
    
}
    return 
ZP_CLASS_AVAILABLE


public 
plugin_init() 
{
    
// Plugin Info
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_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"PLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar("zp_zclass_hunterl4d2"szCvarFCVAR_SERVER|FCVAR_SPONLY)
}

/******************************************************
        [Events]
******************************************************/

public zp_user_infected_post(idinfector// Infected post
{
    
// 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^"")
    }
}

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

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


public 
false_g_b_is_Jumper(id// Remove super jumps to  human/survivor/nemesis
{
    
g_b_isJumper[id] = false
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
__________________

Last edited by AmineKyo; 04-13-2012 at 14:35.
AmineKyo 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 15:46.


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