@name Gun
@persist Prop:entity Props:array Shells:entity Shells2:array
@model models/weapons/w_rif_m4a1.mdl
interval(10) 
timer("delete",10000)
timer("break",10000)
Prop:applyForce(Prop:forward()*100000000) 
 E = entity() 
    P = owner()
if(changed(P:keyReload())& P:keyReload() ){Prop = propSpawn("models/Items/AR2_Grenade.mdl", E:toWorld(vec(15,0,6)), P:eyeAngles(), 0)
, soundPlay(1,0, "weapons/m249/m249-1.wav")
Prop:setTrails(5,5,1, "trails/smoke", vec(100,100,100),100)
Prop:setAlpha(255)
Props:pushEntity(Prop)
}

if(clk("delete") & Props:count()) {
    Props:shiftEntity():propDelete()
    Props:propDelete()
}

if(changed(P:keyReload())& P:keyReload() ){Shells = propSpawn("models/weapons/shells/shell_sniperrifle.mdl", E:toWorld(vec(0,5,-10)), E:angles(), 0)
Shells2:pushEntity(Shells)
}
if(clk("break") & Shells2:count()) {
    Shells2:shiftEntity():propDelete()
    Shells2:propDelete()
}
