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

help zombie class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shayan123
BANNED
Join Date: Oct 2020
Location: GB
Old 03-27-2021 , 12:10   help zombie class
Reply With Quote #1

hi guyz i want to change press E to Press G
someone can fix pls

PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <engine>
#include <fun>
#include <fakemeta>
#include <hamsandwich>

#define ID_FURY (taskid - TASK_FURY)

// Task offsets
enum (+= 100)
{
    
TASK_FURY
}

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

// Zombie Attributes
new const zclass10_name[] = { "Zombie Cerberus Dog"}
new const 
zclass10_info[] = { "You have a fury" }
new const 
zclass10_model[] = { "Cerberus_frk_14" }
new const 
zclass10_clawmodel[] = { "v_doghands.mdl" }

const 
zclass10_health 1200
const zclass10_speed 275

const Float:zclass10_gravity 0.8
const Float:zclass10_knockback 0.5

new const idle[] = "zombie_plague/cerberus_idle.wav"
new const fury[] = "zombie_plague/cerberus_fury.wav"
new const normaly[] = "zombie_plague/cerberus_normaly.wav"

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

// Plugin info.
#define PLUGIN "[ZP] Zombie Class: Cerberus Dog"
#define VERSION "0.1"
#define AUTHOR "DJHD!"

// Variables
new g_cerberusg_veces[33], i_fury_time[33], g_maxplayers

// Cvar Pointers
new cvar_furycvar_furytime

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

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
cvar_fury register_cvar("zp_cerberus_fury""1")
    
cvar_furytime register_cvar("zp_cerberus_fury_time""10.0")
    
    static 
szCvar[30]
    
formatex(szCvarcharsmax(szCvar), "v%s by %s"VERSIONAUTHOR)
    
register_cvar("zp_zclass_cerberus"szCvarFCVAR_SERVER|FCVAR_SPONLY)
    
    
register_logevent("roundStart"2"1=Round_Start")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
    
g_maxplayers get_maxplayers()
}

public 
plugin_precache()
{
    
g_cerberus zp_register_zombie_class(zclass10_namezclass10_infozclass10_modelzclass10_clawmodelzclass10_healthzclass10_speedzclass10_gravityzclass10_knockback)
    
    
precache_sound(idle)
    
precache_sound(fury)
    
precache_sound(normaly)
}

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

public zp_user_infected_post(idinfector)
{
    if (
zp_get_user_zombie_class(id) == g_cerberus)
    {
        
client_print(idprint_chat"[ZP] You have %d fury to use press - ^"E^""get_pcvar_num(cvar_fury))
        
        
g_veces[id] = get_pcvar_num(cvar_fury)
        
i_fury_time[id] = get_pcvar_num(cvar_furytime)
        
emit_sound(idCHAN_STREAMidle1.0ATTN_NORM0PITCH_HIGH)
        
remove_task(id)
    }
}

public 
zp_user_humanized_post(taskid)
{
    new 
id ID_FURY
    remove_task
(id+TASK_FURY)
    
set_user_godmode(id0)
}


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

public fw_PlayerPreThink(id)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
new button get_user_button(id)
    new 
oldbutton get_user_oldbutton(id)
    
    if (
zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_cerberus))
    {
        if (!(
oldbutton IN_USE) && (button IN_USE))
            
clcmd_furia(id)
    }
    
    return 
PLUGIN_CONTINUE
}

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

public clcmd_furia(taskid)
{
    new 
id ID_FURY
    
    
if(!is_user_alive(id) || !is_user_connected(id)|| !zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_zombie_class(id) != g_cerberus)
        return 
PLUGIN_HANDLED
    
    
if(g_veces[id] > 0)
    {
        
g_veces[id] = g_veces[id] -1
        
        set_task
(0.1"effects"id+TASK_FURY__"b")
        
i_fury_time[id] = get_pcvar_num(cvar_furytime)
        
        
set_task(1.0"ShowHUD"id+TASK_FURY__"a"i_fury_time[id])
        
        
emit_sound(idCHAN_STREAMfury1.0ATTN_NORM0PITCH_HIGH)
    }
    else
    {
        
client_print(idprint_chat"[ZP] You dont have more fury.")
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_HANDLED
}

public 
effects(id)
{
    if(!
is_user_alive(id) || !is_user_connected(id)|| !zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_zombie_class(id) != g_cerberus)
        return
        
    static 
origin[3]
    
get_user_origin(idorigin)
    
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
    
write_byte(TE_PARTICLEBURST// TE id
    
write_coord(origin[0]) // x
    
write_coord(origin[1]) // y
    
write_coord(origin[2]) // z
    
write_short(130// radius
    
write_byte(70// color
    
write_byte(3// duration (will be randomized a bit)
    
message_end()
    
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
    
write_byte(TE_DLIGHT// TE id
    
write_coord(origin[0]) // x
    
write_coord(origin[1]) // y
    
write_coord(origin[2]) // z
    
write_byte(22// radius
    
write_byte(255// r
    
write_byte(0// g
    
write_byte(30// b
    
write_byte(2// life
    
write_byte(0// decay rate
    
message_end()
    
    
set_user_godmode(id1)
    
    
set_task(get_pcvar_float(cvar_furytime), "remove_fury"id)
}

public 
ShowHUD(id)
{
    if(
is_user_alive(id))
    {
        
i_fury_time[id] = i_fury_time[id] - 1;
        
set_hudmessage(2001000, -1.0, -0.4601.01.10.00.0, -1)
        
show_hudmessage(id"Fury: %d"i_fury_time[id]+1)
    }
    else
    {
        
remove_task(id+TASK_FURY)
    }
}

public 
remove_fury(taskid)
{
    new 
id ID_FURY
    
    remove_task
(id+TASK_FURY)
    
    
set_user_godmode(id0)
    
emit_sound(idCHAN_STREAMnormaly1.0ATTN_NORM0PITCH_HIGH)
}

public 
roundStart()
{
    for(new 
1<= g_maxplayersi++)
    {
        
i_fury_time[i] = get_pcvar_num(cvar_furytime)
        
remove_task(i)
    }

shayan123 is offline
Send a message via ICQ to shayan123 Send a message via AIM to shayan123 Send a message via Yahoo to shayan123 Send a message via Skype™ to shayan123
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 02:42.


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