Senior Member
|
08-04-2020
, 23:19
Re: Plugin's commands and hud messages arent shown
|
#13
|
Quote:
Originally Posted by OciXCrom
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(PLUGIN, VERSION, AUTHOR) 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(id, uspeed) 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(id, pev_health, float(pev(id, pev_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(id, CHAN_VOICE, ability1start, 1.0, ATTN_NORM, 0, PITCH_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(170, 255, 42, -1.0, 0.86, 0, 6.0, 0.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(id, nspeed) message_begin(MSG_ONE_UNRELIABLE,fov,{0,0,0},id) write_byte(90) message_end() emit_sound(id, CHAN_VOICE, ability1end, 1.0, ATTN_NORM, 0, PITCH_NORM) } if(cooldown[id] == -1) { Ready[id] = 1 } } if(Ready[id] == 1) { set_dhudmessage(170, 255, 42, -1.0, 0.86, 0, 6.0, 0.9,0.1,0.1) show_dhudmessage(id, "[Berserk] [-] [Ready]") } if(Ready2[id] == 0) { cooldown2[id] -= 1 set_dhudmessage(170, 255, 42, -1.0, 0.86, 0, 6.0, 0.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(170, 255, 42, -1.0, 0.86, 0, 6.0, 0.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(id, CHAN_STREAM, deathsound, 1.0, ATTN_NORM, 0, PITCH_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(victim, inflictor, id, Float:damage, damagebits) { 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(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) { static Float:color[3] color[0] = float(r) color[1] = float(g) color[2] = float(b) set_pev(entity, pev_renderfx, fx) set_pev(entity, pev_rendercolor, color) set_pev(entity, pev_rendermode, render) set_pev(entity, pev_renderamt, float(amount)) }
stock fm_set_playermodel_ent(id, const modelname[],anim) { fm_set_rendering(id, kRenderFxNone, 255, 255, 255, kRenderTransTexture, 1) static modelpath[100] formatex(modelpath, sizeof modelpath - 1, "models/player/%s/%s.mdl", modelname, modelname) if (!pev_valid(g_ent_playermodel[id])) { g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(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_movetype, MOVETYPE_FOLLOW) set_pev(g_ent_playermodel[id], pev_aiment, id) set_pev(g_ent_playermodel[id], pev_animtime, get_gametime()+0.1) set_pev(g_ent_playermodel[id], pev_framerate, 1.0) set_pev(g_ent_playermodel[id], pev_sequence, anim) set_pev(g_ent_playermodel[id], pev_owner, id) } engfunc(EngFunc_SetModel, g_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.
|
|