Raised This Month: $ Target: $400
 0% 

Plugin's commands and hud messages arent shown


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
AnimalMonster
Senior Member
Join Date: May 2020
Old 08-02-2020 , 22:48   Plugin's commands and hud messages arent shown
Reply With Quote #1

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

#define PLUGIN "Regular Zombie CSO-LIKE"
#define VERSION "1.0"
#define AUTHOR "DeclineD"

new cooldown[33]
new 
cooldown2[33]
new const 
hp 15000
new const speed 240
new Float:gravity 0.300
new Float:knockback 1.0
new Ready[33]
new 
Ready2[33]
new 
abilityended[33]
new 
abilitystarted[33]
new 
Float:ability1cooldown 20.0
new Float:ability2cooldown 10.0

new g_ent_playermodel[33
new 
regular

new const zombieh[] = { "v_regular.mdl" }
new const 
zombiemodel1[] = { "regularzombie" }
new const 
zombiemodel2[] = { "regularzombiehost"}
new const 
bothmodels[] = { "regularzombie""regularzombiehost" }
new const 
ability1start[] = { "csolike/start.wav" }
new const 
ability2sound[] = { "csolike/ability2.wav" }
new const 
ability1end[] = { "csolike/end.wav" }
new const 
infectsound[] = { "csolike/regularinfect.wav" }
new const 
hit[] = { "csolike/hit1.wav""csolike/hit2.wav"}
new const 
deathsound[] = { "csolike/death1.wav""csolike/death2.wav" }
new const 
health[] = {
    
2000,
    
3000,
    
4000,
    
5000
}

public 
plugin_init() {

    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("+drop","ability1")
    
register_clcmd("+reload","ability2")
    
register_concmd("+drop","ability1")
    
register_concmd("+reload","ability2")
    
RegisterHam(Ham_TakeDamage,"player","dmg")
    
register_event("DeathMsg","death","a")
    
    
regular zp_register_zombie_class("Regular Zombie","\r[\yCSO-LIKE\r] [\yBerserk\r|\yReproduce\r]",bothmodels ,zombieh,hp,speed,gravity,knockback)
    
}
public 
plugin_precache()
{
    
precache_sound(ability1start)
    
precache_sound(ability1end)
    
precache_sound(ability2sound)
    
precache_sound(infectsound)
    
precache_sound(hit)
    
precache_sound(deathsound)
    
precache_model("models/player/regularzombiehost/regularzombiehost.mdl")
    
precache_model("models/player/regularzombie/regularzombie.mdl")
}

public 
ability1(id)
{
    if(
is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == regular && !zp_get_user_nemesis(id))
    {
        new 
Float:uspeed 1000.0

        
if(Ready[id] == 1)
        {
            
client_cmd(id,"cl_forwardspeed 1600")
            
client_cmd(id,"cl_backspeed 1600")
            
set_user_maxspeed(iduspeed)
            
            
cooldown[id] = 21
            Ready
[id] = 0
            abilitystarted
[id] = 1
            abilityended
[id] = 0
            
            set_task
(ability1cooldown,"ready",id)
        }
        else 
client_print(id,print_chat,"[Ability] Wait 'till ability is ready")
    }
}
public 
ability2(id)
{
    if(
zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == regular && zp_get_user_nemesis(id))
    {
        new 
healthnum
        
        
if(Ready2[id] == 1)
        {
            
healthnum random_num(0,charsmax(health))
            
set_pev(idpev_healthfloat(pev(idpev_health) + health[healthnum]))
            
            
Ready2[id] = 0
        
            emit_sound
(idCHAN_STREAMability1start1.0ATTN_NORM0PITCH_NORM)
    
            
set_task(ability2cooldown,"ready2",id)
        }
        else 
client_print(id,print_chat,"[Ability] Wait 'till ability is ready")
    }
}

public 
hud(id)
{
    if(
Ready[id] == 1)
    {
        
set_hudmessage(17025585, -1.00.8506.00.4,0.1,0.1)
        
show_hudmessage(id"[Berserk - Ready] [G]")
    }

    if(
Ready[id] == 0)
    {
        
set_hudmessage(17025585, -1.00.8506.00.5,0.1,0.1)
        
show_hudmessage(id"[Berserk - %d] [G]",cooldown[id] - 1)
    }
    
    if(
Ready2[id] == 1)
    {
        
set_hudmessage(25500, -1.00.9106.00.4,0.1,0.1)
        
show_hudmessage(id"[Reproduce - Ready] [R]")
    }

    if(
Ready2[id] == 0)
    {
        
set_hudmessage(25500, -1.00.9106.00.4,0.1,0.1)
        
show_hudmessage(id"[Reproduce - %d] [R]",cooldown2[id] - 1)
    }
    
    if(
abilityended[id] == 1)
    {
        
abilityended[id] = 0
        emit_sound
(idCHAN_STREAMability1end1.0ATTN_NORM0PITCH_NORM)
    }
}
public 
ready(id)
{
    
Ready[id] = 1
    abilityended
[id] = 1
    abilitystarted
[id] = 0
}
public 
ready2(id)
{
    
Ready2[id] = 1
}
public 
death(id)
{
    if(
is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == regular && !zp_get_user_nemesis(id))
    {
        
emit_sound(idCHAN_STREAMdeathsound1.0ATTN_NORM0PITCH_NORM)
    }
}
    
public 
zp_user_infected_post(id)
{
    if(
zp_get_user_zombie_class(id) == regular && zp_get_user_zombie(id) && zp_get_user_nemesis(id))
    {    
        if(
zp_get_user_first_zombie(id))
        {
            
fm_set_playermodel_ent(id,zombiemodel2,0)
        }
        else 
fm_set_playermodel_ent(id,zombiemodel1,0)
    
        
Ready[id] = 1
        Ready2
[id] = 1
    
        set_task
(0.5,"hud",id,_,_,"b")
        
emit_sound(id,CHAN_STREAM,infectsound,1.0,ATTN_NORM,0,PITCH_NORM)
    }
}

public 
dmg(victiminflictoridFloat:damagedamagebits)
{
    new 
Zombie[33]
    new class[
33]
    new 
Human[33]

    
Zombie[id] = zp_get_user_zombie(id)
    
Human[id] = !zp_get_user_zombie(id)
    class[
id] = zp_get_user_zombie_class(id) == regular
    
    
if(Zombie[id] == inflictor && class[id])
    {
        if(
abilityended[id] == 0)
        {
            
SetHamParamFloat(4,damage 2.0)
        }
        else if(
abilityended[id] == 1)
        {
            
SetHamParamFloat(4,damage 1.0)
        }
        
    }
    
    if(
Human[id] == inflictor)
    {    
            
emit_sound(id,CHAN_STREAM,hit,1.0,ATTN_NORM,0,PITCH_NORM)
    }
}

stock fm_set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16)
{
    static 
Float:color[3]
    
color[0] = float(r)
    
color[1] = float(g)
    
color[2] = float(b)
    
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))
}
stock fm_set_playermodel_ent(id, const modelname[],anim

    
fm_set_rendering(idkRenderFxNone255255255kRenderTransTexture1)
    
    static 
modelpath[100
    
formatex(modelpathsizeof modelpath 1"models/player/%s/%s.mdl"modelnamemodelname
    
    if (!
pev_valid(g_ent_playermodel[id]))
    { 
        
g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 
        
        if (!
pev_valid(g_ent_playermodel[id])) return
        
        
set_pev(g_ent_playermodel[id], pev_classname"regular_classname"
        
set_pev(g_ent_playermodel[id], pev_movetypeMOVETYPE_FOLLOW
        
set_pev(g_ent_playermodel[id], pev_aimentid)
        
set_pev(g_ent_playermodel[id], pev_animtimeget_gametime()+0.1)
        
set_pev(g_ent_playermodel[id], pev_framerate1.0)
        
set_pev(g_ent_playermodel[id], pev_sequenceanim)
        
set_pev(g_ent_playermodel[id], pev_ownerid
        
    } 
    
    
engfunc(EngFunc_SetModelg_ent_playermodel[id], modelpath

idk what to do now, i even upgraded to amxx 1.8.3... but nothing

SO
the plugin's commands doesn t work idk why and the plugin's hud messages aren t shown.
The code seems to be fine but when i try use it doesn't work,
I want to mention that im using zp 4.3 patched from moddb , i will try use zp 4.3 fix5a instead to see if that s the problem

Last edited by AnimalMonster; 08-03-2020 at 00:17.
AnimalMonster is offline
 



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 13:49.


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