@name Tank Keys and HUD
@inputs Entity:entity Active HUD:wirelink Tank:entity
@outputs Eject Ok
@persist [Driver O]:entity Speed
@trigger all

if(first()){
runOnTick(1)

O = owner()

HUD:egpRoundedBox(1,vec2(110,50),vec2(200,40))
HUD:egpColor(1,vec4(90,90,90,200))  

HUD:egpRoundedBox(2,vec2(110,50),vec2(10,30))
HUD:egpColor(2,vec4(0,255,0,200))  


HUD:egpText(3,Speed:toString(),vec2(105,40))
HUD:egpColor(3,vec4(255,255,255,200))  
}

if(Active){
Speed = round(Tank:vel():length()/2)
HUD:egpText(3,Speed:toString(),vec2(100,40)) 
HUD:egpRoundedBox(2,vec2(110,50),vec2(Speed,30))
}


if(~Active & Active){
    
Driver = Entity:driver()

if(Driver:steamID() == "STEAM_0:0:5665681" | Driver == O | Driver:steamID() == "STEAM_0:1:20785590"){
Eject = 0    
}else{
Driver:hintDriver("* Your not allowed to sit here! *",7)
Eject = 1
}
}else{
Eject = 0
}
