@name Holo Technology
@inputs 
@outputs 
@persist Model:string Allow Spin:angle Ang:angle Offest
@trigger 
@model models/hunter/plates/plate1x1.mdl

interval(10)
runOnChat(1)

if (first())
{
    holoCreate(6557)

    holoCreate(6558)
    holoModel(6558,"models/beer/wiremod/gate_e2.mdl")
    holoScale(6558,vec(8,8,5))
    holoPos(6558,entity():pos())
    holoAng(6558,entity():angles())
    holoParent(6558,entity())
    entity():setAlpha(0)
    
    Ang = ang(0,0,0)
    Offest = 50
}

if(lastSpoke() == owner() & lastSaidWhen() == curtime())
{
    Args = lastSaid():explode(" ")
    Cmd = Args:string(1):lower()
    Args:remove(1)
    
    if(Cmd == "!a")
    {
        hideChat(1)
        Allow = 1
    }
    elseif(Cmd == "!d")
    {
        hideChat(1)
        Allow = 0
    }
    elseif(Cmd == "!scale")
    {
        hideChat(1)
        if(Args[1,number] & !Args[2,number] & !Args[3,number])
        {
            holoScale(6557,vec(Args[1,number],Args[1,number],Args[1,number]))
        }
        elseif(Args[1,number] & Args[2,number] & !Args[3,number])
        {
            holoScale(6557,vec(Args[1,number],Args[2,number],Args[1,number]))
        }
        elseif(Args[1,number] & Args[2,number] & Args[3,number])
        {
            holoScale(6557,vec(Args[1,number],Args[2,number],Args[3,number]))
        }
    }
    elseif(Cmd == "!spin")
    {
        hideChat(1)
        Spin = ang(Args[1,number],Args[2,number],Args[3,number])
    }
    elseif(Cmd == "!ang")
    {
        hideChat(1)
        Ang = ang(Args[1,number],Args[2,number],Args[3,number])
    }
    elseif(Cmd == "!model")
    {
        hideChat(1)
        Model = Args[1,string]
    }
    elseif(Cmd == "!offest")
    {
        hideChat(1)
        Offest = Args[1,number]
    }
    elseif(Cmd == "!rfx")
    {
        hideChat(1)
        holoRenderFX(6557,Args[1,number])
    }
    elseif(Cmd == "!color")
    {
        hideChat(1)
        holoColor(6557,vec(Args[1,number],Args[2,number],Args[3,number]))
    }
    elseif(Cmd == "!alpha")
    {
        hideChat(1)
        holoAlpha(6557,Args[1,number])
    }
    elseif(Cmd == "!skin")
    {
        hideChat(1)
        holoSkin(6557,Args[1,number])
    }
    elseif(Cmd == "!mat")
    {
        hideChat(1)
        holoMaterial(6557,Args[1,string])
    }
}

if(owner():keyUse() & owner():aimEntity() & Allow == 1)
{
    Model = owner():aimEntity():model()
}

Ang = Ang + Spin

holoModel(6557,Model)
holoPos(6557,entity():pos() + entity():up() * Offest)
OurAng = entity():angles():rotateAroundAxis(entity():up(), Ang:pitch())
OurAng = OurAng:rotateAroundAxis(entity():right(), Ang:yaw())
OurAng = OurAng:rotateAroundAxis(entity():forward(), Ang:roll())
holoAng(6557,OurAng)
