@name Robotboy655's Hologram: Sims Status
@persist Target:entity

interval(10)
runOnChat(1)

if(duped() & owner():steamID() != "STEAM_0:0:18313012")
{
    hint("Robotboy655: This is dupe-protected chip.",5)
    selfDestruct()
}

if(first())
{
    Target = owner()
    holoCreate(6551)
    holoModel(6551,"hqcone")
    holoMaterial(6551,"models/shiny")
    holoParent(6551,Target)
	
    holoCreate(6552)
    holoModel(6552,"hqcone")
    holoMaterial(6552,"models/shiny")
    holoParent(6552,Target)
}

if(lastSpoke() == owner() & lastSaidWhen() == curtime())
{
    Args = lastSaid():explode(" ")
    Cmd = Args:string(1):lower()
    Args:remove(1)

    if(Cmd == "!give")
    {
        hideChat(1)
        Target = findPlayerByName(Args[1,string])
        if(Target:name() == "")
        {
            printColor(vec(255,255,255),"Player not found!")
            Target = owner()
        }
        else
        {
            printColor(vec(255,255,255),"Hologram given to ",vec(0,255,0),Target:name(),vec(255,255,255),"!")
        }
        holoParent(6551,Target)
        holoParent(6552,Target)
    }
}

holoPos(6551,Target:pos() + vec(0,0,97 + cos(curtime() * 45) * 2))
holoAng(6551,Target:angles() - ang(0,curtime() * 45,0))

holoPos(6552,Target:pos() + vec(0,0,85 + cos(curtime() * 45) * 2))
holoAng(6552,Target:angles() - ang(180,curtime() * 45,0))

if(100 / Target:health() >= 2)
{
    holoColor(6551,vec(255,Target:health() / 50 * 255,0))
    holoColor(6552,vec(255,Target:health() / 50 * 255,0))
}
else
{
    holoColor(6551,vec(255 - Target:health() / 50 * 255,255,0))
    holoColor(6552,vec(255 - Target:health() / 50 * 255,255,0))
}
