@name HoloGraphic Man
@inputs [Pod Cam]:wirelink 
@outputs 
@persist 
@trigger 
runOnTick(1)

if (first()) {
    holoCreate(1)
    holoModel(1,"models/odessa.mdl")
    
    holoCreate(2)
    holoPos(2,holoEntity(1):toWorld(vec(-30,0,80)))
    holoAlpha(2,0)
    holoParent(2,holoEntity(1))
}

local Seat = Pod["Entity",entity]
local Driver = Seat:driver()
local W = Driver:keyForward()
local A = Driver:keyLeft()
local S = Driver:keyBack()
local D = Driver:keyRight()
local R = Driver:keyReload()
local Mouse1 = Driver:keyAttack1()
local Mouse2 = Driver:keyAttack2()
local Shift = Driver:keySprint()
local Active = Driver:isPlayer()
local On = Active
local E = entity()
Cam["Activated", number] = Active

Cam["Position", vector] = holoEntity(2):pos()
Cam["Parent", entity] = holoEntity(2)

rangerFilter(E)
Ranger = rangerOffset(10,holoEntity(1):pos(),-holoEntity(1):up())

holoPos(1,vec(holoEntity(1):pos():x(),holoEntity(1):pos():y(),Ranger:position():z() + 1))

if(changed(W) & W){
    holoAnim(1,13)
}
if(changed(Shift & W) & Shift & W){
    holoAnim(1,15)
}
if((changed(W)|changed(S)|changed(Shift))&!W & !S & !Shift){
    holoAnim(1,5)
}

if(W){
    holoPos(1,holoEntity(1):toWorld(vec(1,0,0)))
}
if(S){
    holoPos(1,holoEntity(1):toWorld(vec(-1,0,0)))
}
if(Shift & W){
    holoPos(1,holoEntity(1):toWorld(vec(1.6,0,0)))
}
if(Shift & S){
    holoPos(1,holoEntity(1):toWorld(vec(-1.6,0,0)))
}
if(A){
    holoAng(1,holoEntity(1):angles()+ang(0,1.4,0))
}
if(D){
    holoAng(1,holoEntity(1):angles()-ang(0,1.4,0))
}
