Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2024, 02:54:49 AM
Home Help Login Register
News: Zombie Master 2 discussion

  Show Posts
Pages: [1]
1  Other / Trouble in Terrorist Town / Re: Sniper-scope sensitivity changed? on: May 01, 2011, 07:15:24 PM
where is this change? is it in the svn? How can I update a server to this change?
2  Other / Trouble in Terrorist Town / Help my crippled limbs code on: April 22, 2011, 05:25:16 PM
I think it has something to do with the dmginfo or something, this is in it's own file.
print("success")
function crippleLegsToggle(ply, toggleBool)

if toggleBool == true then
ply:SetWalkSpeed(1)
end

if toggleBool == false then
ply:SetWalkSpeed(250)
end
end

function crippleArmsToggle(ply, toggleBool)

if toggleBool == True then
ply.StripWeapon(ply:GetActiveWeapon())
end
end



function crippleLimbs(ply, hitgroup, dmginfo)
-- Lets cripple their legs first
if (hitgroup == HITGROUP_LEFTLEG or
hitgroup == HITGROUP_RIGHTLEG) then

--If they were shot in the leg (or they fell) then lower their leg health
if ply.legHealth != 0 and ply:HasEquipmentItem(EQUIP_ARMOR) == false then
ply.legHealth = ply.legHealth - dmginfo.GetBaseDamage()/2
end
--When their leghealth is zero? Cripple them
if ply.legHealth == 0 or dmginfo:IsFallDamage() then
print("Got this far...")
crippleLegsToggle(ply, true)
end

end

if (hitgroup == HITGROUP_LEFTARM or
       hitgroup == HITGROUP_RIGHTARM) then

if ply.armHealth !=0 and ply:HasEquipmentItem(EQUIP_ARMOR) == false then
ply.armHealth = ply.armHealth - dmginfo.GetBaseDamage()/2
end
if ply.armHealth == 0 then
crippleArmsToggle(ply, true)
end
end
end

hook.Add("EntityTakeDamage", "CrippleLimbHook", crippleLimbs(ent, ent:LastHitGroup() or HITGROUP_GENERIC, dmginfo))


Also in player.lua
armHealth == 50
legHealth == 50
3  Other / Trouble in Terrorist Town / Crippled Limbs: Change accuracy for one player? on: April 16, 2011, 11:12:36 AM
How would i change the accuracy of a gun, just for one person? That is, when a 'crippled' function gets sent, it makes the ply's weapon half as accurate. Sorry if that is a bit vague  :P
Pages: [1]


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.011 seconds with 19 queries.