local function drawinfo(text, color)
local w, h = surface_GetTextSize(text)
surface_SetTextColor(color.r, color.g, color.b, color.a)
local x = -(w * 0.5)
local y = infoy
surface_SetTextPos(x, infoy)
surface_DrawText(text)
infoy = infoy - (h - 20)
return x, y, w, h, infoy
end
local simpleMathVecOffset = Vector(0, 0, -0)
local pang = Angle(0,90,90)
function GM:DrawPlayerInfo(pl, simpleMath)
if (not pl:Alive()) then return end
if (pl:GetNoDraw()) then return end
if (pl:GetTeamTable().HidePlayerInfo) then return end
local bone = pl:LookupBone('ValveBiped.Bip01_Head1')
if (not bone) then return end
local pos, _ = pl:GetBonePosition(bone)
if (not pos) then return end
infoy = 0
if pl.InfoOffset then
pos.z = pos.z + pl.InfoOffset + 7.5
else
pos.z = pos.z + 12.5
end
if (not pos) then return end
infoy = 0
if pl.InfoOffset then
pos.z = pos.z + pl.InfoOffset + 7.5
else
pos.z = pos.z + 2.5
end
pang.y = (LocalPlayer():EyeAngles().y - 90)
cam_Start3D2D(pos, pang, 0.03)
local x, y, w, h, y2
local org = pl:GetOrg()
if (org ~= nil) then
x, y, w, h, y2 = drawinfo(org, pl:GetOrgColor())
end
x, y, w, h, y2 = drawinfo(pl:Name(), color_white)
if pl:HasLicense() then
surface_SetMaterial(material_licence)
surface_SetDrawColor(color_white.r, color_white.g, color_white.b)
surface_DrawTexturedRect(x + w + 10, y2 + 118, 128, 128)
end
if pl:GetNWBool('isHandcuffed') then
x, y, w, h, y2 = drawinfo('В наручниках', color_red)
end
if pl:IsWanted() then
x, y, w, h, y2 = drawinfo('Разыскивается', color_red)
else
x, y, w, h, y2 = drawinfo(pl:GetJobName(), pl:GetJobColor())
end
local isadmin = (LocalPlayer():Team() == TEAM_ADMIN)
if (LocalPlayer():IsHitman() or isadmin) and pl:HasHit() and (pl ~= LocalPlayer()) then
x, y, w, h, y2 = drawinfo('Заказ ' .. rp_FormatMoney(pl:GetHitPrice()), color_red)
end
local teamtbl = LocalPlayer():GetTeamTable()
if teamtbl.medic or isadmin then
x, y, w, h, y2 = drawinfo(pl:Health() .. ' HP', color_red)
end
if (teamtbl.bmidealer or isadmin) and (pl:Armor() > 0) then
x, y, w, h, y2 = drawinfo(pl:Armor() .. ' Armor', color_blue)
end
if talkingplayers[pl] then
x, y, w, h, y2 = drawinfo('Говорит', color_white)
elseif pl:IsTyping() then
x, y, w, h, y2 = drawinfo('Печатает', color_white)
end
cam_End3D2D()
end