i have v defined check it
for _, v in ipairs ( getElementsByType ( "ped" ) ) do
if ( getElementModel ( v ) == 281 ) then
local x, y, z = getElementPosition( v )
if isElementOnScreen( v ) then
local X, Y = getScreenFromWorldPosition( x, y, z )
if X then
dxDrawRectangle( X - 30, Y - 20, 60, 10, tocolor( 0, 0, 0, 120) )
local health = exports["extra_health"]:getElementExtraHealth(v)
local lineLength = 56 * ( health / 100 )
dxDrawRectangle( X - 28, Y - 18, lineLength, 6, tocolor( 255, 0, 0, 100 ) )