Code:
CreateClientConVar( "wallhackttt_enabled", 0, true, false )
traitors = {"Default"}
hook.Add( "HUDPaint", "Wallhackttt", function()
local twep = {"spiderman's_swep", "weapon_ttt_trait_defilibrator", "weapon_ttt_xbow", "weapon_ttt_dhook", "weapon_awp", "weapon_ttt_ak47", "weapon_jihadbomb", "weapon_ttt_knife", "weapon_ttt_c4", "weapon_ttt_decoy", "weapon_ttt_flaregun", "weapon_ttt_phammer", "weapon_ttt_push", "weapon_ttt_radio", "weapon_ttt_sipistol", "weapon_ttt_teleport", "weapon_ttt_awp", "weapon_mad_awp", "weapon_real_cs_g3sg1", "weapon_ttt_cvg_g3sg1", "weapon_ttt_g3sg1", "weapon_ttt_healthstation5", "weapon_ttt_sentry", "weapon_ttt_poison_dart", "weapon_ttt_trait_defibrillator"}
if ConVarExists( "wallhackttt_enabled" ) and GetConVar("wallhackttt_enabled"):GetInt() == 1 then
for k,v in pairs ( player.GetAll() ) do
local Position = ( v:GetPos() + Vector( 0,0,80 ) ):ToScreen()
local Position2 = ( v:GetPos() + Vector( 0,0,70 ) ):ToScreen()
local Name = ""
if v == LocalPlayer() then Name = "" else Name = v:Name() end
color = Color( 255, 255, 255, 255 )
if GAMEMODE****und_state == ROUND_ACTIVE then
if has_value(traitors, v:Name()) then color = Color(255, 0, 0, 255) end
if not v:IsSpec() then
draw.DrawText( Name, "Trebuchet18", Position.x, Position.y, color, 1 )
hex = gradient(0, 100, v:Health())
healthcolor = Color(hex2rgb(hex))
draw.DrawText( v:Health(), "Trebuchet18", Position2.x, Position2.y, healthcolor, 1 )
end
end
for _,v in pairs( ents.GetAll() ) do
if v and IsValid(v) and (table.HasValue(twep, v:GetClass()) and !v.HatESPTracked) then
local pl = v.Owner
if pl and IsValid(pl) and pl:IsTerror() then
local Position = ( pl:GetPos() + Vector( 0,0,80 ) ):ToScreen()
local Name = ""
if pl == LocalPlayer() then Name = "" else Name = pl:Name() end
if pl:IsDetective() then
color = Color(0, 0, 255, 255)
else
traitor = pl:Name()
color = Color(255, 0, 0, 255)
if not (table.HasValue(traitors,traitor)) then
chat.AddText( pl, Color(255,125,0), " is a ",Color(255,0,0), "TRAITOR",Color(255,125,0), " with a ",Color(255,0,0),v:GetClass().."!")
table.insert(traitors,#traitors+1, traitor)
for k, v in pairs( traitors ) do
print(k, v)
end
end
end
draw.DrawText( Name, "Trebuchet18", Position.x, Position.y, color, 1 )
end
end
end
end
end
end)
function hex2rgb(hex)
hex = hex:gsub("#","")
return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6))
end
function gradient(min, max, val)
if (val > max) then val = max end
if (val < min) then val = min end
local v = val - min
local d = (max - min) * 0.5
local red, green
if (v <= d) then
green = math.floor((255 * v) / d + 0.5)
red = 255
else
green = 255
red = math.floor(255 - (255 * (v-d)) / (max - min - d) + 0.5)
end
return string.format("#%02x%02x00", red, green)
end