function math.frandom(minn, maxn)
	minn = minn * 100
	maxn = maxn * 100
	return math.random(minn, maxn)*0.01
end

	function onPrimaryAttack()
		if not _PlayerInfo(Owner, "alive") or not _PlayerInfo( Owner, "connected") then return end
		local accuracy = 0.06
		local plyang = vecAdd(_PlayerGetShootAng(Owner), vector3(math.frandom(-accuracy, accuracy), math.frandom(-accuracy, accuracy), math.frandom(-accuracy, accuracy)))
		local vecpos = _PlayerGetShootPos(Owner)
		_TraceSetMask(MASK_SHOT)
		_TraceLine(vecpos, plyang, 8000, Owner)
	   local hitpos = _TraceEndPos()
        _EffectInit()
		 _EffectSetEnt(Owner)
		 --_EffectSetOrigin( vecAdd(vecpos, vecMul(plyang, 8000)) )
		 _EffectSetOrigin( hitpos )
		 _EffectSetStart( vecpos )
		 _EffectSetScale(10000)
		 --_EffectSetMagnitude(1)
		 --_EffectSetRadius(1)
		_EffectDispatch("GunshipTracer")
		local damage = 12
		if _TraceHitNonWorld() then
			if _TraceGetEnt() <= _MaxPlayers() then
				local vecz = _EntGetPos(_TraceGetEnt()).z
				local endz = _TraceEndPos().z
				if _PlayerIsCrouching(_TraceGetEnt()) then
					if endz > vecz+43 then damage = damage*3 end
				else
					if endz > vecz+82 then damage = damage*3 end
				end
			end
			local tracedEntity = _TraceGetEnt()
			_RunString("_TraceAttack("..tracedEntity..", "..MyIndex..", "..Owner..", "..damage..", 'bullet')")
		end
		_SWEPUseAmmo(MyIndex, 0, 1)
		_EntEmitSound(MyIndex, "nox/vulcan_fire.wav")
	end

function onReload() return true end
function getWeaponSwapHands() return true end
function getWeaponFOV() return 75 end
function getWeaponSlot() return 1 end
function getWeaponSlotPos() return 5 end
function getFiresUnderwater() return true end
function getReloadsSingly() return false end
function getPrimaryShotDelay() return 0.1 end
function getPrimaryIsAutomatic() return false end
function getViewKick() return vector3(0, 0, 0) end
function getViewKickRandom() return vector3(0, 0, 0) end
function getViewKickSecondary() return vector3(0.0, 0.0, 0.0) end
function getViewKickRandomSecondary() return vector3(0.0, 0.0, 0.0) end
function getViewModel() return "models/weapons/v_pist_p228.mdl" end
function getWorldModel() return "models/weapons/w_pist_p228.mdl" end
function getClassName() return "weapon_battleaxe" end
function getPrimaryAmmoType() return "357" end	
function getSecondaryAmmoType() return "357" end
function getMaxClipPrimary() return 12 end
function getMaxClipSecondary() return -1 end
function getDefClipPrimary() return 1000 end
function getDefClipSecondary() return -1 end
function getAnimPrefix() return "pistol" end
function getPrintName() return "'Battle Axe' Hand Gun" end
function getPrimaryScriptOverride() return 2 end
function getSecondaryScriptOverride() return 3 end
function getDeathIcon() return "d_p228" end
