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

Plugin's commands and hud messages arent shown


Post New Thread Reply   
 
Thread Tools Display Modes
AnimalMonster
Senior Member
Join Date: May 2020
Old 08-03-2020 , 21:10   Re: Plugin's commands and hud messages arent shown
Reply With Quote #11

Quote:
Originally Posted by OciXCrom View Post
Like I said, there is no +drop command. It's a single action command and it's just "drop". And no, you can't hook buttons. IN_RELOAD isn't the R button, it's the +reload command.
Btw why do the reload com.and if player is in server console and write reloads the map but doesn t reload the gun instead
AnimalMonster is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-04-2020 , 06:29   Re: Plugin's commands and hud messages arent shown
Reply With Quote #12

Because "reload" is a command that restarts the map? It's same as "restart". How can the server reload its gun?!
For the 15th time, "+command" is not the same as "command".
__________________

Last edited by OciXCrom; 08-04-2020 at 06:30.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 08-04-2020, 09:07
Black Rose
This message has been deleted by Black Rose. Reason: nvm
AnimalMonster
Senior Member
Join Date: May 2020
Old 08-04-2020 , 23:19   Re: Plugin's commands and hud messages arent shown
Reply With Quote #13

Quote:
Originally Posted by OciXCrom View Post
Because "reload" is a command that restarts the map? It's same as "restart". How can the server reload its gun?!
For the 15th time, "+command" is not the same as "command".
Ok ik and btw i solved it. + i don't know the whole command list from cs 1.6. I through it could be like at drop command without + or - and to do the same thing.

Later posting this under zombie plague topic with models ans sounds, or we'll see.

How did you SOLVE it?

Solved, i edited since i said a stupid thing and now i realised, i didn t sleep this night..., i forgot to add "!" zp_get_user_nemesis
Also i optimized the code a little and added the things i needed to add.

For the ones that are interested on getting the sounds and models , search Regular Zombie and download the .ogg files then convert them to .wav by online and the models search for them, i renamed every model and sounds.

That's the final code:
PHP Code:
/* Hey This Is My First Zombie Class Made | This Class Will Bring You The CSO REGULAR ZOMBIE On Your Server With The Origin
And Host Skins As In CSO*/

#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 300
new Float:nspeed 300.0
new Float:gravity 0.600
new Float:knockback 1.0
new Ready[33]
new 
Ready2[33]

new 
g_ent_playermodel[33
new 
regular
new fade
new fov

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,
    
5000
}

public 
plugin_init() {

    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("drop","ability1")
    
register_clcmd("lastinv","ability2")
    
    
RegisterHam(Ham_TakeDamage,"player","dmg")
    
register_event("DeathMsg","death","a")
    
    
fov get_user_msgid("SetFOV")
    
fade get_user_msgid("ScreenFade")
    
regular zp_register_zombie_class("Regular Zombie","\r[\yCSO-LIKE\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 700.0

        
if(Ready[id] == 1)
        {
            
client_cmd(id,"cl_forwardspeed 1600")
            
client_cmd(id,"cl_backspeed 1600")
            
set_user_maxspeed(iduspeed)
            
            
cooldown[id] = 20
            Ready
[id] = 0
            
            message_begin
(MSG_ONE_UNRELIABLE,fade,{0,0,0},id)
            
write_short(2<<12)
            
write_short(9<<12)
            
write_short(0x0000)
            
write_byte(255)
            
write_byte(0)
            
write_byte(0)
            
write_byte(100)
            
message_end()
            
            
message_begin(MSG_ONE_UNRELIABLE,fov,{0,0,0},id)
            
write_byte(120)
            
message_end()
        }
        else if(
Ready[id] == 0) return
    }
}
public 
ability2(id)
{
    if(
is_user_alive(id) && 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
            cooldown2
[id] = 10
            
            message_begin
(MSG_ONE_UNRELIABLE,fade,{0,0,0},id)
            
write_short(2<<12)
            
write_short(1<<5)
            
write_short(0x0000)
            
write_byte(0)
            
write_byte(255)
            
write_byte(0)
            
write_byte(235)
            
message_end()
            
            
emit_sound(idCHAN_VOICEability1start1.0ATTN_NORM0PITCH_NORM)
        }
        else if(
Ready2[id] == 0) return
    }
}
public 
checkhud(id)
{
    if(!
zp_get_user_zombie(id) && zp_get_user_zombie_class(id) != regular && zp_get_user_nemesis(id))
    return

    if(
Ready[id] == 0)
    {
        
cooldown[id] -= 1
    
        set_dhudmessage
(17025542, -1.00.8606.00.9,0.1,0.1)
        
show_dhudmessage(id"[Berserk] [-] [%d Seconds]",cooldown[id] + 1)
    
        if(
cooldown[id] == 10)
        {
            
client_cmd(id,"cl_forwardspeed 400")
            
client_cmd(id,"cl_backspeed 400")
            
set_user_maxspeed(idnspeed)
            
            
message_begin(MSG_ONE_UNRELIABLE,fov,{0,0,0},id)
            
write_byte(90)
            
message_end()
            
            
emit_sound(idCHAN_VOICEability1end1.0ATTN_NORM0PITCH_NORM)
        }
        if(
cooldown[id] == -1)
        {
            
Ready[id] = 1
        
}
    }
    if(
Ready[id] == 1)
    {
        
set_dhudmessage(17025542, -1.00.8606.00.9,0.1,0.1)
        
show_dhudmessage(id"[Berserk] [-] [Ready]")
    }
    
    if(
Ready2[id] == 0)
    {
        
cooldown2[id] -= 1
    
        set_dhudmessage
(17025542, -1.00.8606.00.9,0.1,0.1)
        
show_dhudmessage(id"^n[Reproduce] [-] [%d Seconds]",cooldown2[id] + 1)
    
        if(
cooldown2[id] == -1)
        {
            
Ready2[id] = 1
        
}
    }
    
    if(
Ready2[id] == 1)
    {
        
set_dhudmessage(17025542, -1.00.8606.00.9,0.1,0.1)
        
show_dhudmessage(id"^n[Reproduce] [-] [Ready]")
    }
}

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_nemesis(id))
    {    
        if(
zp_get_user_first_zombie(id))
        {
            
fm_set_playermodel_ent(id,zombiemodel2,0)
            
Ready[id] = 1
            Ready2
[id] = 1
            
            set_task
(0.9,"checkhud",id,_,_,"b")
            
emit_sound(id,CHAN_VOICE,infectsound,1.0,ATTN_NORM,0,PITCH_NORM)
        }
        else {
            
fm_set_playermodel_ent(id,zombiemodel1,0)
            
Ready[id] = 1
            Ready2
[id] = 1
            
            set_task
(1.05,"checkhud",id,_,_,"b")
            
emit_sound(id,CHAN_VOICE,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] && !zp_get_user_nemesis(id))
    {
        if(
cooldown[id] >= 10)
        {
            
SetHamParamFloat(4,damage 10.0)
        }
        else if(
cooldown[id] <= 11)
        {
            
SetHamParamFloat(4,damage 1.0)
        }
        
    }
    
    if(
Human[id] == inflictor)
    {
            
emit_sound(id,CHAN_AUTO,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

THANKS FOR HELPING ME OUT EVERYONE

Also special thanks to Black Rose for showing me the debugging method

Last edited by AnimalMonster; 08-04-2020 at 23:44.
AnimalMonster is offline
Reply


Thread Tools
Display Modes

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 10:21.


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