local lineLength1 = 0
local sWidth,sHeight = guiGetScreenSize ( )
function DXdraw2 ( )
for i, player in ipairs(getElementsByType("player")) do
local team = getPlayerTeam(player)
if team and getTeamName(team) == "Team1" then
for i, player in ipairs(getPlayersInTeam(team)) do
local healtha = getElementHealth(player)
lineLength1 = 192* ( healtha / 100 )
ticka = getTickCount ()
local maxHealtha = 100;
local colourPercent = ( healtha / maxHealtha ) * 200;
local red, green;
if healtha < ( maxHealtha / 2 ) then
red = 88;
green = ( healtha / 50 ) * ( colourPercent * 2 );
else
green = 154;
red = 88 - ( ( healtha - 50 ) / 50 ) * 88;
end
end
end
end
local color1 = tocolor( 88, 154, 24, 100 )
local color2 = tocolor( 88, 154, 24, 200 )
dxDrawRectangle(sWidth-785,sHeight-39,192.0,25.0,color1, false)
dxDrawRectangle(sWidth-785,sHeight-39,lineLength1,25.0,color2,false) -- THIS IS LINE 266
end