@name Night Rider
@inputs  Car:entity Cam:entity
@outputs Active CamDirection:vector CamPos:vector Throttle Steering Engine Handbrake On
@persist 
@trigger 
runOnTick(1)
runOnChat(1)



if(Car:driver()!=owner() & Car:driver()){
    Handbrake = 1
    Car:ejectPod()
    }
    else{Handbrake = 0}

if(chatClk(owner())){
    Chat = owner():lastSaid():explode(" ")
    if(Chat:string(1)=="/camon"){
        hideChat(1)
        Active = 1
        }
    if(Chat:string(1)=="/camoff"){
        hideChat(1)
        Active = 0
        }
    if(Chat:string(1)=="/caron"){
        hideChat(1)
        Engine = 1
        }
    if(Chat:string(1)=="/caroff"){
        hideChat(1)
        Engine = 0
        }
    }

CamDirection = Car:forward()
CamPos = Cam:pos()
CamAng = ang(Cam:angles():pitch(),Cam:angles():yaw(),Cam:angles():roll())

if(Engine==1){
    Me = owner()
    if(Me:keyPressed("KEY_W")){
        Throttle = 1
        }
    elseif(Me:keyPressed("KEY_PAD_2")){
        Throttle = -1
        }
    if(Me:keyPressed("KEY_PAD_6")){
        Steering = 1
        }
    elseif(Me:keyPressed("KEY_PAD_4")){
        Steering = 0
        }
    if(Me:keyPressed("KEY_PAD_PLUS")){
        On = 1
        }
    elseif(Me:keyPressed("KEY_PAD_MINUS")){
        On = 0
        }
    }
