资源分享Gmod动态方框透视脚本
Posted fbux
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了资源分享Gmod动态方框透视脚本相关的知识,希望对你有一定的参考价值。
*----------------------------------------------[下载区]----------------------------------------------*
1 CreateClientConVar("ux_ts" , 1 , true , false) 2 3 local ent = FindMetaTable("Entity") 4 local vec = FindMetaTable("Vector") 5 6 hook.Add("HUDPaint" , "ESPhack" , function() 7 8 if ConVarExists( "ux_ts" ) and GetConVar("ux_ts"):GetInt() == 1 then 9 for k , v in pairs (player.GetAll()) do 10 if(!v:Alive()) then continue end 11 if(v:IsDormant()) then continue end 12 if(v == LocalPlayer()) then continue end 13 local Position = (v:GetPos() + Vector(0,0,80)) :ToScreen() 14 draw.DrawText(v:Name(), "Default", Position.x, Position.y, Color(255,0,0), 1) 15 local hp = v:Health() 16 draw.DrawText(hp , "Default" , Position.x , Position.y + 10 , Color(0,255,0), 1) 17 local pos = ent.GetPos(v); 18 local poss = pos + Vector(0, 0, 70); 19 local pos = vec.ToScreen(pos); 20 local poss = vec.ToScreen(poss); 21 local h = pos.y - poss.y; 22 local w = h / 2; 23 local health = math.Clamp(v:Health(), 0, 100) 24 surface.SetDrawColor(HSVToColor( health / 100 * 120, 1, 1 )); 25 surface.DrawOutlinedRect(pos.x - w / 2, pos.y - h, w, h); 26 end 27 28 29 end 30 end )
*----------------------------------------------[下载区]----------------------------------------------*
*----------------------------------------------[介绍区]----------------------------------------------*
本脚本可动态显示Gmod服务器内玩家方框、名字、血量
方框颜色随玩家血量多少而变化
可通过控制台输入“ux_ts 1/0”来启动/关闭透视
*----------------------------------------------[介绍区]----------------------------------------------*
游戏截图:
以上是关于资源分享Gmod动态方框透视脚本的主要内容,如果未能解决你的问题,请参考以下文章