function onInit()
	_SWEPSetSound(MyIndex, "single_shot", "Weapon_m4a1.Single")
end

function frand(a, b)
	return math.random(a*100,b*100)/100
end

function onPrimaryAttack()
	local vecpos = _PlayerGetShootPos(Owner)
   	local plyang = vecAdd(_PlayerGetShootAng(Owner), vector3(frand(-0.035, 0.035), frand(-0.035, 0.035), frand(-0.035, 0.035)))
	_TraceLine(vecpos, plyang, 10000, Owner)
	_EffectInit()
	_EffectSetEnt(Owner)
	_EffectSetOrigin(_TraceEndPos())
	_EffectSetStart(vecpos)
	_EffectSetScale(2)
	_EffectSetMagnitude(0.2)
	_EffectDispatch("FadingLineTeamSolid")
	if _TraceHitNonWorld() then
		_RunString("_TraceAttack(".._TraceGetEnt()..", "..Owner..", "..Owner..", 5)")
	end
	_SWEPUseAmmo(MyIndex, 0, 1)
end

function getWeaponSwapHands()
	return true
end

function getWeaponFOV()
	return 75	
end

function getWeaponSlot()
	return 3	
end

function getWeaponSlotPos()
	return 7	
end

function getFiresUnderwater()
	return true
end

function getReloadsSingly()
	return false
end

function getDamage()
	return 60
end

function getPrimaryShotDelay()
	return 0.09
end

function getSecondaryShotDelay()
	return 100
end

function getPrimaryIsAutomatic()
	return true
end

function getSecondaryIsAutomatic()
	return false
end

function getPrimaryAmmoType()
	return "357"
end

function getSecondaryAmmoType()
	return "none"
end

function getMaxClipPrimary()
	return 40
end

function getMaxClipSecondary()
	return -1
end
function getDefClipPrimary()
	return 9999
end

function getDefClipSecondary()
	return -1
end

function getPrimaryScriptOverride()
	return 1
end

function getSecondaryScriptOverride()
	return 3
end

function getBulletSpread()
	return vector3( 0.01, 0.01, 0.01 )
end

function getViewKick()
	return vector3( -1.0, 0.0, 0.0)
end

function getViewKickRandom()
	return vector3( 1.0, 1.0, 1.0 )
end

function getViewModel( )
	return "models/weapons/v_smg_p90.mdl"
end

function getWorldModel( )
	return "models/weapons/w_smg_p90.mdl"
end

function getClassName()
	return "weapon_smg"
end

function getAnimPrefix()
	return "rpg"
end

function getPrintName()
	return "SMG :D"
end

function getDeathIcon( )
	return "d_smg"
end
