@name RP Chip Mark III
@inputs 
@outputs Use Vec:vector Warp:number
@persist Vec:vector Warp:number Mode:number Model:string E:entity Ew:entity Scale:number G:entity X Y Z
@trigger 
interval(1)
if(first()){
Mode = 1
Scale = 9999
#[Common Models]
models/props_c17/consolebox01a.mdl   - Thick box
models/props_c17/consolebox05a.mdl   - Thin Box
models/props/cs_assault/money.mdl    - Just Money

models/custom/rprinter.mdl
]#
Use = 0
Warp = 0
Model = "models/props_lab/reciever01a.mdl"
E = entity()
E:setColor(vec4(255,0,0,255))
}

Ew = entity():isWeldedTo()
if(Ew:model()=="models/jaanus/wiretool/wiretool_range.mdl"){
    E:setColor(vec4(0,255,0,255))
    timer("color",5000)
    }

if(clk("color")){E:setAlpha(30)
    E:setColor(vec4(0,0,0,30))
    Ew:setColor(vec4(0,0,0,30))}

if(Mode==1){
if(owner():keyReload()){
findExcludeClass("*")
findIncludeModel(Model)
findInSphere(E:pos(),Scale)
if(find()){
G = findClosest(entity():pos())
if(G:model() == Model){
    if(G!=Ew){
E:setPos(G:pos() + vec(0,0,30))
Ew:setPos(G:pos() + vec(0,0,30))
timer("use",800)
timer("reset",800)
}}
if(Model==""){print(_HUD_PRINTCENTER,"YOU NEED A FUCKING MODEL FIRST")}
}}
}
if(Mode==2){
    if(Ew:model()=="models/props_lab/reciever01b.mdl	"){
    E:setColor(vec4(0,255,255,255))
    }
    if(owner():keyReload()){
findExcludeClass("*")
findIncludeModel(Model)
findInSphere(E:pos(),Scale)
if(find()){
G = findClosest(entity():pos())
if(G:model() == Model){
    
X = G:pos():x()
Y = G:pos():y()
Z= G:pos():z()
Vec = vec(X,Y,Z+30)
timer("use",400)
Warp = 1

}}
if(Model==""){print(_HUD_PRINTCENTER,"YOU NEED A FUCKING MODEL FIRST")}
}}
if(clk("use")){Use = 1
    timer("reset",800)}
if(clk("reset")){Use=0
    Warp = 0}

if(owner():keyZoom()){if(Mode==2){
    X = owner():pos():x() 
    Y = owner():pos():y()
    Z = owner():pos():z() 
    Vec = vec(X,Y,Z+100)
    Warp = 1
    timer("reset",800)
}
    if(Mode==1){
    E:setPos(owner():pos() +vec(0,0,100))    
    Ew:setPos(owner():pos() +vec(0,0,100))
}}
