@name Remote Vehicle Controller
@inputs Num:wirelink VCon:wirelink Cam:wirelink Enter Reload 
@inputs AdvPod:wirelink Plus
@outputs 
@persist Car:entity Ent:entity Pos:vector Engine Lock
@trigger all
interval(10)
Num1=1

Owner=entity():owner()
Ent=Owner:aimEntity()

if(Num1){
N0 = Num:number("0")
N1 = Num:number("1")
N2 = Num:number("2")
N3 = Num:number("3")
N4 = Num:number("4")
N5 = Num:number("5")
N6 = Num:number("6")
N7 = Num:number("7")
N8 = Num:number("8")
N9 = Num:number("9")
Slash = Num:number("/")
Astrix = Num:number("*")
Minus = Num:number("-")
#Plus = Num:number("+")
#Enter = Num:number("enter")
Del = Num:number(".")
Thrust=(N8-N2)
Turn=(N6-N4)
if(Enter&~Enter){Engine=!Engine}
Break=N0
if(Owner:keyUse()&Ent:id()==0){Lock=!Lock}

}else{

W=AdvPod:number("W")
A=AdvPod:number("A")
S=AdvPod:number("S")
D=AdvPod:number("D")
Mouse1=AdvPod:number("Mouse1")
Mouse2=AdvPod:number("Mouse2")
#R=AdvPod:number("R")
Space=AdvPod:number("Space")
Shift=AdvPod:number("Shift")
Zoom=AdvPod:number("Zoom")
Alt=AdvPod:number("Alt")
TurnLeftKey=AdvPod:number("TurnLeftKey")
TurnRightKey=AdvPod:number("TurnRightKey")
X=AdvPod:number("X")
Y=AdvPod:number("Y")
Y=AdvPod:number("Z")
Distance=AdvPod:number("Distance")
Active=AdvPod:number("Active")
Team=AdvPod:number("Team")
Health=AdvPod:number("Health")
Armor=AdvPod:number("Armor")
Bearing=AdvPod:number("Bearing")
Elevation=AdvPod:number("Elevation")
Entity=AdvPod:entity("Entity")
Thrust=W-S
Turn=D-A
if(Reload&~Reload){Engine=!Engine}
Break=Space
if(Mouse2){Lock=!Lock}
}#end of else for Num

VCon:setNumber("Throttle",Thrust)
VCon:setNumber("Steering",Turn)
VCon:setNumber("Handbrake",Break)
VCon:setNumber("Engine",Engine)
VCon:setNumber("Lock",Plus)




Dist=Owner:pos():distance(Ent:pos())
if(Owner:keyUse()&(Dist>200)&Ent:isVehicle()){
    Car=Ent
    #Ctrlr=entity():isConstrainedTo()
    #Ctrlr:createWire(Self,"Spawn","Spawn")
    }
Pos=Car:pos()+vec(0,0,70)
Vel=Car:vel()
if(Owner:keyAttack2()){Dir=Owner:eye()}else{Dir=Car:forward()}

Cam:setVector("Direction",Dir)
Cam:setNumber("Activated",Engine)
Cam:setVector("Position",Pos)
Cam:setVector("Velocity",Vel)
Cam:setNumber("On",Engine)
