Spoiler
function zp_hit(p,s,w,h)
local s_t = player(s,'team')
local p_t = player(p,'team')
if (p_t == 1 and s_t == 2) then
local p_h = player(p,'health') - h
zp_player_hud(p)
if (w == 51) then
zp_msg2(p,4,'You get stunned!@C')
parse('shake '..p..' 100')
parse('speedmod '..p..' '..set_zm_val(zp_p_class[p],3) - 20)
zp_p_stun[p] = 3
end
if (zp_p_health[p] - h > 0) then
if (w < 50 or w > 69) then zp_knockback_func(s,p,w) end
zp_p_health[p] = zp_p_health[p] - h
if (zp_p_health[p] > p_h and zp_p_health[p] < 251) then
parse('setmaxhealth '..p..' '..zp_p_health[p])
parse('sethealth '..p..' '..zp_p_health[p])
return 1
elseif (p_h < 1 and zp_p_health[p] > 250) then
parse('setmaxhealth '..p..' 250')
parse('sethealth '..p..' 250')
return 1
end
else
zp_snd(math.random(4,7))
parse('customkill '..s..' "'..itemtype(w,'name')..'" '..p)
zp_hudtxt2(p,2,1,'',0,0,0)
zp_hudtxt2(p,4,1,'',0,0,0)
return 1
end
elseif (p_t == 2 and s_t == 1) then
local p_h = player(p,'health') - set_zm_val(zp_p_class[s],5)
local p_a = player(p,'armor') - set_zm_val(zp_p_class[s],5)
local p_ap = player(p,'armor')
if (w == 78 or w == 86) then
local wpn = {}
wpn[78] = 'Infected'
wpn[86] = 'Infection Bomb'
wpn[256] = 'Critical Hit'
if (set_zm_val(zp_p_class[s],5) > 0 and p_h > 0 and w ~= 86) then
if (p_ap > 0) then
if (p_a > 0) then
parse('setarmor '..p..' '..p_a)
else
parse('setarmor '..p..' 0')
end
else
parse('sethealth '..p..' '..p_h)
end
return 1
else
if (set_zm_val(zp_p_class[s],5) == 0) then w = 256 end
local p_x = player(p,'x')
local p_y = player(p,'y')
parse('customkill '..s..' "'..wpn[w]..'" '..p)
parse('spawnplayer '..p..' '..p_x..' '..p_y)
zp_snd(math.random(1,3))
if (zp_hud_flashlight > 0) then imagealpha(p_light[p],0) end
return 1
end
end
end
zp_player_hud(p)
end
function zp_join(p)
zp_join_set(p)
end
local s_t = player(s,'team')
local p_t = player(p,'team')
if (p_t == 1 and s_t == 2) then
local p_h = player(p,'health') - h
zp_player_hud(p)
if (w == 51) then
zp_msg2(p,4,'You get stunned!@C')
parse('shake '..p..' 100')
parse('speedmod '..p..' '..set_zm_val(zp_p_class[p],3) - 20)
zp_p_stun[p] = 3
end
if (zp_p_health[p] - h > 0) then
if (w < 50 or w > 69) then zp_knockback_func(s,p,w) end
zp_p_health[p] = zp_p_health[p] - h
if (zp_p_health[p] > p_h and zp_p_health[p] < 251) then
parse('setmaxhealth '..p..' '..zp_p_health[p])
parse('sethealth '..p..' '..zp_p_health[p])
return 1
elseif (p_h < 1 and zp_p_health[p] > 250) then
parse('setmaxhealth '..p..' 250')
parse('sethealth '..p..' 250')
return 1
end
else
zp_snd(math.random(4,7))
parse('customkill '..s..' "'..itemtype(w,'name')..'" '..p)
zp_hudtxt2(p,2,1,'',0,0,0)
zp_hudtxt2(p,4,1,'',0,0,0)
return 1
end
elseif (p_t == 2 and s_t == 1) then
local p_h = player(p,'health') - set_zm_val(zp_p_class[s],5)
local p_a = player(p,'armor') - set_zm_val(zp_p_class[s],5)
local p_ap = player(p,'armor')
if (w == 78 or w == 86) then
local wpn = {}
wpn[78] = 'Infected'
wpn[86] = 'Infection Bomb'
wpn[256] = 'Critical Hit'
if (set_zm_val(zp_p_class[s],5) > 0 and p_h > 0 and w ~= 86) then
if (p_ap > 0) then
if (p_a > 0) then
parse('setarmor '..p..' '..p_a)
else
parse('setarmor '..p..' 0')
end
else
parse('sethealth '..p..' '..p_h)
end
return 1
else
if (set_zm_val(zp_p_class[s],5) == 0) then w = 256 end
local p_x = player(p,'x')
local p_y = player(p,'y')
parse('customkill '..s..' "'..wpn[w]..'" '..p)
parse('spawnplayer '..p..' '..p_x..' '..p_y)
zp_snd(math.random(1,3))
if (zp_hud_flashlight > 0) then imagealpha(p_light[p],0) end
return 1
end
end
end
zp_player_hud(p)
end
function zp_join(p)
zp_join_set(p)
end
i'm was try to remove the addhook ("hit","zp_hit")
And the HUD, HP not work,khock back,...
Spoiler
-- Dofiles --
zp_dir = 'sys/lua/zombieplague/zp_'
snd_dir = 'zombieplague/zp_'
dofile(zp_dir..'config.cfg')
dofile(zp_dir..'values.lua')
dofile(zp_dir..'func_up.lua')
dofile(zp_dir..'console.lua')
dofile(zp_dir..'filter.lua')
dofile(zp_dir..'func_m.lua')
dofile(zp_dir..'func.lua')
dofile(zp_dir..'settings.cfg')
-- Hooks --
addhook("team","zp_team")
addhook("join","zp_join")
addhook("spawn","zp_spawn")
addhook("kill","zp_kill")
addhook("hit","zp_hit") ------->i'm delte this!
addhook("menu","zp_menu")
addhook("serveraction","zp_serveraction")
addhook("minute","zp_minute")
addhook("projectile","zp_projectile")
addhook("second","zp_second")
addhook("startround","zp_startround")
addhook("endround","zp_endround")
addhook("drop","zp_drop")
addhook("die","zp_die")
addhook("parse","zp_parse")
addhook("buy","zp_buy")
addhook("leave","zp_leave")
addhook("say","zp_say")
zp_dir = 'sys/lua/zombieplague/zp_'
snd_dir = 'zombieplague/zp_'
dofile(zp_dir..'config.cfg')
dofile(zp_dir..'values.lua')
dofile(zp_dir..'func_up.lua')
dofile(zp_dir..'console.lua')
dofile(zp_dir..'filter.lua')
dofile(zp_dir..'func_m.lua')
dofile(zp_dir..'func.lua')
dofile(zp_dir..'settings.cfg')
-- Hooks --
addhook("team","zp_team")
addhook("join","zp_join")
addhook("spawn","zp_spawn")
addhook("kill","zp_kill")
addhook("hit","zp_hit") ------->i'm delte this!
addhook("menu","zp_menu")
addhook("serveraction","zp_serveraction")
addhook("minute","zp_minute")
addhook("projectile","zp_projectile")
addhook("second","zp_second")
addhook("startround","zp_startround")
addhook("endround","zp_endround")
addhook("drop","zp_drop")
addhook("die","zp_die")
addhook("parse","zp_parse")
addhook("buy","zp_buy")
addhook("leave","zp_leave")
addhook("say","zp_say")
It you guy find a way to fix armor bug pls tell me!
1 thing lua is not by me it make by Blazzingxx
Link to his Zombie plauge : http://www.unrealsoftware.de/files_show.php?file=288