I have tried, and failed many times with this.
Creating a bar (anywhere) and having it be full black. However, each time a player gets a kill a part of gray will cover the black. So, pretty much like a health bar, but in reverse. I need it so that it will reset to full black each time the player reaches a certain amount of kills. This is my code for the setup of that:
[lua]
function wephud()
local pl = client or LocalPlayer()
if(!pl:Alive()) then return end
NextWeapon = "Glock 30"
Needed = 25
if pl:Frags() > 25 then
NextWeapon = "Beretta M-92"
Needed = 50
end
if pl:Frags() > 50 then
NextWeapon = "Desert Eagle"
Needed = 75
end
if pl:Frags() > 75 then
NextWeapon = "TMP"
Needed = 100
end
if pl:Frags() > 100 then
NextWeapon = "MP-5K"
Needed = 125
end
if pl:Frags() > 125 then
NextWeapon = "AKS-74u"
Needed = 150
end
if pl:Frags() > 150 then
NextWeapon = "FN-P90"
Needed = 175
end
if pl:Frags() > 175 then
NextWeapon = "SPAS-12"
Needed = 200
end
if pl:Frags() > 200 then
NextWeapon = "Winchester"
Needed = 225
end
if pl:Frags() > 225 then
NextWeapon = "AK-47"
Needed = 250
end
surface.SetTextColor(255, 255, 255, 255)
surface.SetTextPos(ScrW()/2.5+45, ScrH()-79)
surface.SetFont("WeaponFontHUD")
surface.DrawText("Kills: "..pl:Frags().." out of "..Needed)
surface.SetTextColor(255, 255, 255, 255)
surface.SetTextPos(ScrW() / 2.5 + 43, ScrH() - 54)
surface.DrawText("Next Weapon: "..NextWeapon)
end
[/lua]
(Just in case that helps)
[editline]2:20AM[/editline]
Actually, just for now the best placement for the bar would be in the middle of the screen. I can fix it to my liking later.
Sorry, you need to Log In to post a reply to this thread.