AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Help / Support Help - ZClass Tank not work (https://forums.alliedmods.net/showthread.php?t=289816)

plazma 10-30-2016 07:50

Help - ZClass Tank not work
 
Why not work when i press G where is the problem i use zp 4.3


please fix it.


PHP Code:

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

#define PLUGIN "[ZP] Zombie Class: Tank"
#define VERSION "1.0"
#define AUTHOR "Dias Leon"

new g_zclassic_zombie
new bool:g_hasSpeedBoost[33]
new 
bool:g_hasSpeedTime[33]
new 
g_sb_maxspeedg_sb_timeg_msgSetFOVcvar_zombiehp
new cvar_spnvgcolor[3]

new const 
zombie_pressure[][] = { "zombie_plague/zombie_pressure.wav" }
new const 
zombie_pre_idle1[][] = { "zombie_plague/zombie_pre_idle_1.wav" }
new const 
zombie_pre_idle2[][] = { "zombie_plague/zombie_pre_idle_2.wav" }

new const 
zclass_name[] = { "Normal Zombie" }
new const 
zclass_info[] = { "| G -> Fast Run" }
new const 
zclass_model[] = { "tank_zombi_origin" }
new const 
zclass_clawmodel[] = { "v_knife_tank_zombi.mdl" }
const 
zclass_health 2000
const zclass_speed 280
const Float:zclass_gravity 0.7
const Float:zclass_knockback 1.3

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_forward(FM_EmitSound"fw_EmitSound")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
    
// Death Msg
    
register_event("DeathMsg""Death""a")
    
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
    
    
register_clcmd("drop""madness")
    
g_msgSetFOV get_user_msgid("SetFOV")
    
g_sb_maxspeed register_cvar("zp_znormal_pressure_maxspeed""500.0")
    
g_sb_time register_cvar("zp_znormal_pressure_time""10.0")
    
cvar_zombiehp register_cvar("zp_znormal_pressure_health""100")
    
cvar_spnvgcolor[0] = register_cvar("zp_znormal_prenvg_color_R""255")
    
cvar_spnvgcolor[1] = register_cvar("zp_znormal_prenvg_color_G""0")
    
cvar_spnvgcolor[2] = register_cvar("zp_znormal_prenvg_color_B""0")
}

public 
Death()
{
    
g_hasSpeedTime[read_data(2)] = false
    g_hasSpeedBoost
[read_data(2)] = false
}

public 
fwHamPlayerSpawnPost(id)
{
    
g_hasSpeedTime[id] = false
    g_hasSpeedBoost
[id] = false
}

public 
plugin_precache()
{
    new 
i
    
    g_zclassic_zombie 
zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)

    
//Sounds
    
for (0sizeof zombie_pressurei++)
        
engfunc(EngFunc_PrecacheSoundzombie_pressure[i])
    for (
0sizeof zombie_pre_idle1i++)
        
engfunc(EngFunc_PrecacheSoundzombie_pre_idle1[i])
    for (
0sizeof zombie_pre_idle2i++)
        
engfunc(EngFunc_PrecacheSoundzombie_pre_idle2[i])
}

public 
zp_user_infected_post(id)
{
    if(
zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclassic_zombie)
    {
        
//client_cmd(id, "bind F1 use_skill")
        
client_print(idprint_center"[G] -> Fast Run")
    }
}

public 
madness(id)
{        
    if (!
zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclassic_zombie)
        return 
PLUGIN_CONTINUE;
        
    
#if defined FOR_ADMINS_A_FLAG
        
if ( !( get_user_flags(id) & ADMINACCESS))
            return 
PLUGIN_CONTINUE
    
#endif
    
    
if (!is_user_alive(id))
    {
        
client_print(idprint_center"Can be used only when you still alive")
        return 
PLUGIN_HANDLED
    
}
    if (
g_hasSpeedBoost[id])
    {
        
client_print(idprint_center"Max Speed Up !!!")
        return 
PLUGIN_HANDLED
    
}
    if (
g_hasSpeedTime[id])
    {
        
client_print(idprint_center"You may not use this at this time")
        return 
PLUGIN_HANDLED
    
}
    if (
pev(idpev_health) < 1+get_pcvar_num(cvar_zombiehp))
    {
        
client_print(idprint_center"You don't have enough HP")
        return 
PLUGIN_HANDLED
    
}

    
g_hasSpeedBoost[id] = true

    set_pev
(idpev_maxspeedget_pcvar_float(g_sb_maxspeed))
    
set_task(get_pcvar_float(g_sb_time), "boost_over"id)
    
set_task(3.0"zombie_pre_idle1_sound"id)
    
set_task(5.0"zombie_pre_idle2_sound"id)
    
set_task(7.0"zombie_pre_idle1_sound"id)
    
set_task(9.0"zombie_pre_idle2_sound"id)
    
fov(id)
    
speed_glow(id)
    
speed_aura(id)
    
fm_set_user_health(idpev(idpev_health)-get_pcvar_num(cvar_zombiehp))
    
engfunc(EngFunc_EmitSoundidCHAN_VOICEzombie_pressure[random_num(0sizeof zombie_pressure 1)], 1.0ATTN_NORM0PITCH_NORM)
    
set_task(0.1"message_textmsg"id)

    return 
PLUGIN_HANDLED
}

public 
boost_over(id)
{
    if(
g_hasSpeedBoost[id])
    {
        
g_hasSpeedBoost[id] = false
        g_hasSpeedTime
[id] = true
        fov_end
(id)
        
set_task(get_pcvar_float(g_sb_time), "boost_reset"id)
        
client_print(idprint_center"You can continue use after 10 seconds")
    }
}

public 
boost_reset(idg_hasSpeedTime[id] = false

public fov(id)
{
    
message_begin(MSG_ONEg_msgSetFOV_id)
    
write_byte(110// angle
    
message_end()
}

public 
fov_end(id)
{
    
message_begin(MSG_ONEg_msgSetFOV_id)
    
write_byte(90// angle
    
message_end()
}

public 
zombie_pre_idle1_sound(idengfunc(EngFunc_EmitSoundidCHAN_VOICEzombie_pre_idle1[random_num(0sizeof zombie_pre_idle1 1)], 1.0ATTN_NORM0PITCH_NORM)

public 
zombie_pre_idle2_sound(idengfunc(EngFunc_EmitSoundidCHAN_VOICEzombie_pre_idle2[random_num(0sizeof zombie_pre_idle2 1)], 1.0ATTN_NORM0PITCH_NORM)

public 
fw_PlayerPreThink(id)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED
        
    
#if defined FOR_ADMINS_A_FLAG
        
if ( !( get_user_flags(id) & ADMINACCESS) )
            return 
PLUGIN_CONTINUE
    
#endif
    
    
if (g_hasSpeedBoost[id])
    {
        
set_pev(idpev_maxspeedget_pcvar_float(g_sb_maxspeed))        
    }
    return 
PLUGIN_CONTINUE
}

public 
speed_glow(id)
{
    if (
g_hasSpeedBoost[id])
    {

    if (
zp_get_user_zombie_class(id) == g_zclassic_zombie && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
{
    if(
pev(idpev_maxspeed) != 1.0)
        
fm_set_rendering(idkRenderFxGlowShellFloat:{ 255.00.00.0 }, kRenderNormal25)
}
    
// Keep sending aura messages
    
set_task(0.1"speed_glow"id)
    }
}

public 
speed_aura(id)
{
    if (
g_hasSpeedBoost[id])
    {
    
// Get player origin
    
static Float:originF[3]
    
pev(idpev_originoriginF)

    
// Colored Aura
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_DLIGHT// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
write_byte(10// radius
    
write_byte(get_pcvar_num(cvar_spnvgcolor[0])) // r
    
write_byte(get_pcvar_num(cvar_spnvgcolor[1])) // g
    
write_byte(get_pcvar_num(cvar_spnvgcolor[2])) // b
    
write_byte(10// life
    
write_byte(0// decay rate
    
message_end()
    
    
// Keep sending aura messages
    
set_task(0.1"speed_aura"id)
    }
}

stock fm_set_user_maxspeed(indexFloat:speed = -1.0
{
    
engfunc(EngFunc_SetClientMaxspeedindexspeed);
    
set_pev(indexpev_maxspeedspeed);

    return 
1;
}

stock fm_set_user_health(idhealth)
{
    (
health 0) ? set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid);
}

stock fm_set_rendering(entityfx kRenderFxNoneFloat:color[3] = { 255.0255.0255.0 }, render kRenderNormalamount 16)
{
    
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))
    
}

public 
message_textmsg()
{
    static 
textmsg[22]
    
get_msg_arg_string(2textmsgcharsmax(textmsg))
    
    
// Block drop weapon related messages
    
if (equal(textmsg"#Weapon_Cannot_Be_Dropped"))
    {
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;



plazma 10-31-2016 05:33

Re: Help - ZClass Tank not work
 
up

thekiller123 11-02-2016 09:23

Re: Help - ZClass Tank not work
 
Try this:

PHP Code:

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

#define PLUGIN "[ZP] Zombie Class: Tank"
#define VERSION "1.0"
#define AUTHOR "Dias Leon"

new g_zclassic_zombie
new bool:g_hasSpeedBoost[33]
new 
bool:g_hasSpeedTime[33]
new 
g_sb_maxspeedg_sb_timeg_msgSetFOVcvar_zombiehp
new cvar_spnvgcolor[3]

new const 
zombie_pressure[][] = { "zombie_plague/zombie_pressure.wav" 
new const 
zombie_pre_idle1[][] = { "zombie_plague/zombie_pre_idle_1.wav" 
new const 
zombie_pre_idle2[][] = { "zombie_plague/zombie_pre_idle_2.wav" }

new const 
zclass_name[] = { "Normal Zombie" }
new const 
zclass_info[] = { "| G -> Fast Run" }
new const 
zclass_model[] = { "tank_zombi_origin" 
new const 
zclass_clawmodel[] = { "v_knife_tank_zombi.mdl" }
const 
zclass_health 2000
const zclass_speed 280
const Float:zclass_gravity 0.7
const Float:zclass_knockback 1.3

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_forward(FM_EmitSound"fw_EmitSound")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
    
// Death Msg
    
register_event("DeathMsg""Death""a")
    
register_message(get_user_msgid("TextMsg"), "message_textmsg")
    
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
    
    
register_clcmd("drop""madness")
    
g_msgSetFOV get_user_msgid("SetFOV")
    
g_sb_maxspeed register_cvar("zp_znormal_pressure_maxspeed""500.0")
    
g_sb_time register_cvar("zp_znormal_pressure_time""10.0")
    
cvar_zombiehp register_cvar("zp_znormal_pressure_health""100")
    
cvar_spnvgcolor[0] = register_cvar("zp_znormal_prenvg_color_R""255")
    
cvar_spnvgcolor[1] = register_cvar("zp_znormal_prenvg_color_G""0")
    
cvar_spnvgcolor[2] = register_cvar("zp_znormal_prenvg_color_B""0")
}

public 
Death()
{
    
g_hasSpeedTime[read_data(2)] = false
    g_hasSpeedBoost
[read_data(2)] = false
}

public 
fwHamPlayerSpawnPost(id)
{
    
g_hasSpeedTime[id] = false
    g_hasSpeedBoost
[id] = false
}

public 
plugin_precache()
{
    new 
i
    
    g_zclassic_zombie 
zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)

    
//Sounds
    
for (0sizeof zombie_pressurei++)
        
engfunc(EngFunc_PrecacheSoundzombie_pressure[i])
    for (
0sizeof zombie_pre_idle1i++)
        
engfunc(EngFunc_PrecacheSoundzombie_pre_idle1[i])
    for (
0sizeof zombie_pre_idle2i++)
        
engfunc(EngFunc_PrecacheSoundzombie_pre_idle2[i])
}

public 
zp_user_infected_post(id)
{
    if(
zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclassic_zombie)
    {
        
client_print(idprint_center"[G] -> Fast Run")
    }
}

public 
madness(id)
{
    if(
is_user_alive(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_zclassic_zombie))
    {   
        if (!
is_user_alive(id))
        {
            
client_print(idprint_center"Can be used only when you still alive")
            return 
PLUGIN_HANDLED
        
}
        if (
g_hasSpeedBoost[id])
        {
            
client_print(idprint_center"Max Speed Up !!!")
            return 
PLUGIN_HANDLED
        
}
        if (
g_hasSpeedTime[id])
        {
            
client_print(idprint_center"You may not use this at this time")
            return 
PLUGIN_HANDLED
        
}
        if (
pev(idpev_health) < 1+get_pcvar_num(cvar_zombiehp))
        {
            
client_print(idprint_center"You don't have enough HP")
            return 
PLUGIN_HANDLED
        
}

        
g_hasSpeedBoost[id] = true

        set_pev
(idpev_maxspeedget_pcvar_float(g_sb_maxspeed))
        
set_task(get_pcvar_float(g_sb_time), "boost_over"id)
        
set_task(3.0"zombie_pre_idle1_sound"id)
        
set_task(5.0"zombie_pre_idle2_sound"id)
        
set_task(7.0"zombie_pre_idle1_sound"id)
        
set_task(9.0"zombie_pre_idle2_sound"id)
        
fov(id)
        
speed_glow(id)
        
speed_aura(id)
        
fm_set_user_health(idpev(idpev_health)-get_pcvar_num(cvar_zombiehp))
        
engfunc(EngFunc_EmitSoundidCHAN_VOICEzombie_pressure[random_num(0sizeof zombie_pressure 1)], 1.0ATTN_NORM0PITCH_NORM)
    }
    return 
PLUGIN_CONTINUE
}

public 
boost_over(id)
{
    if(
g_hasSpeedBoost[id])
    {
        
g_hasSpeedBoost[id] = false
        g_hasSpeedTime
[id] = true
        fov_end
(id)
        
set_task(get_pcvar_float(g_sb_time), "boost_reset"id)
        
client_print(idprint_center"You can continue use after 10 seconds")
    }
}

public 
boost_reset(idg_hasSpeedTime[id] = false

public fov(id)
{
    
message_begin(MSG_ONEg_msgSetFOV_id)
    
write_byte(110// angle
    
message_end()
}

public 
fov_end(id)
{
    
message_begin(MSG_ONEg_msgSetFOV_id)
    
write_byte(90// angle
    
message_end()
}

public 
zombie_pre_idle1_sound(idengfunc(EngFunc_EmitSoundidCHAN_VOICEzombie_pre_idle1[random_num(0sizeof zombie_pre_idle1 1)], 1.0ATTN_NORM0PITCH_NORM)

public 
zombie_pre_idle2_sound(idengfunc(EngFunc_EmitSoundidCHAN_VOICEzombie_pre_idle2[random_num(0sizeof zombie_pre_idle2 1)], 1.0ATTN_NORM0PITCH_NORM)

public 
fw_PlayerPreThink(id)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
if (g_hasSpeedBoost[id])
    {
        
set_pev(idpev_maxspeedget_pcvar_float(g_sb_maxspeed))        
    }
    return 
PLUGIN_CONTINUE
}

public 
speed_glow(id)
{
    if (
g_hasSpeedBoost[id])
    {
        if (
zp_get_user_zombie_class(id) == g_zclassic_zombie && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
        {
            if(
pev(idpev_maxspeed) != 1.0)
                
fm_set_rendering(idkRenderFxGlowShellFloat:{ 255.00.00.0 }, kRenderNormal25)
        }

        
// Keep sending aura messages
        
set_task(0.1"speed_glow"id)
    }
}

public 
speed_aura(id)
{
    if (
g_hasSpeedBoost[id])
    {
    
// Get player origin
    
static Float:originF[3]
    
pev(idpev_originoriginF)

    
// Colored Aura
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_DLIGHT// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
write_byte(10// radius
    
write_byte(get_pcvar_num(cvar_spnvgcolor[0])) // r
    
write_byte(get_pcvar_num(cvar_spnvgcolor[1])) // g
    
write_byte(get_pcvar_num(cvar_spnvgcolor[2])) // b
    
write_byte(10// life
    
write_byte(0// decay rate
    
message_end()
    
    
// Keep sending aura messages
    
set_task(0.1"speed_aura"id)
    }
}

stock fm_set_user_maxspeed(indexFloat:speed = -1.0
{
    
engfunc(EngFunc_SetClientMaxspeedindexspeed);
    
set_pev(indexpev_maxspeedspeed);

    return 
1;
}

stock fm_set_user_health(idhealth)
{
    (
health 0) ? set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid);
}

stock fm_set_rendering(entityfx kRenderFxNoneFloat:color[3] = { 255.0255.0255.0 }, render kRenderNormalamount 16)
{
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))
}

public 
message_textmsg()
{
    static 
textmsg[22]
    
get_msg_arg_string(2textmsgcharsmax(textmsg))
    
    
// Block drop weapon related messages
    
if (equal(textmsg"#Weapon_Cannot_Be_Dropped"))
        return 
PLUGIN_HANDLED
        
    
return PLUGIN_CONTINUE



plazma 11-04-2016 06:43

Re: Help - ZClass Tank not work
 
not work when i press G nothing happen

thekiller123 11-07-2016 07:39

Re: Help - ZClass Tank not work
 
Try again.


All times are GMT -4. The time now is 15:02.

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