@name Hit Helper V1
@inputs HUD:wirelink
@outputs 
@persist Tar:entity Cl:array T Width Height
@trigger 

runOnChat(1)

if(first() | dupefinished()){
    Tar = owner()
    Cl = players()
    for(I=1, Cl:count()){
        if(Cl[I, entity]==owner()){
            Cl:remove(I)
            }
        }
    Width = egpScrW(owner())    
    Height = egpScrH(owner())
    holoCreate(1)
    holoCreate(2)
    holoVisible(1, Cl, 0)
    holoVisible(2, Cl, 0 )
    holoModel(1, "hq_cone")
    holoModel(2, "hq_cylinder")
    holoColor(1, vec(255,0,0))
    holoColor(2, vec(255,0,0))
    holoAng(1, ang(0,0,180))
    holoScale(2, vec(0.5, 0.5, 2))
    HUD:egpResolution(vec2(0,0), vec2(500,500))
    HUD:egpScale(vec2(0,500), vec2(0,500))
    HUD:egpClear()
    HUD:egpText(1, "Target: "+Tar:name(), vec2(Width/1.4, Height/6))
    HUD:egpText(2, "Job: "+Tar:team():teamName(), vec2(Width/1.4, Height/5.4))
    HUD:egpText(3, "Distance: " + ceil(Tar:pos():distance(owner():pos())), vec2(Width/1.4, Height/5))
    HUD:egpText(4, "Health: " + Tar:health(), vec2(Width/1.4, Height/4.6))
    for(I=1, 4){
        HUD:egpColor(I, vec(0,120,255))
        }
    
    }
runOnTick(1)
T+=10
holoPos(1, Tar:pos()+vec(0,0,90 + 3*cos(T))) 
holoPos(2, Tar:pos()+vec(0,0,105 + 3*cos(T)))

if(chatClk(owner())){
    
        O=owner():lastSaid():lower():explode(" ")
        if(O:string(1)=="/tar"){
            hideChat(1)
            Tar = findPlayerByName(O:string(2))
                if(Tar:isPlayer() & Tar:isAlive()){
                    hint("Player: " + Tar:name() + " found: " + Tar:pos():distance(owner():pos()) + " units away.", 3)
                    HUD:egpText(1, "Target: "+Tar:name(), vec2(Width/1.4, Height/6))
                    HUD:egpText(2, "Job: "+Tar:team():teamName(), vec2(Width/1.4, Height/5.4))
                    
                }
            }
        
}

HUD:egpText(3, "Distance: " + ceil(Tar:pos():distance(owner():pos())), vec2(Width/1.4, Height/5))
HUD:egpText(4, "Health: " + Tar:health(), vec2(Width/1.4, Height/4.6))
