Initiate = false
MyTime = 0
LastFire = 0

function onPrimaryAttack()
	if _CurTime() >= LastFire+4.5 then
		LastFire = _CurTime()
		_RunString("JuggernautCannon("..Owner..")")
	end
end

function onSecondaryAttack()
	if _CurTime() >= LastFire+1.2 then
		LastFire = _CurTime()
		_RunString("JuggernautMiniCannon("..Owner..")")
	end
end

function onThink()
	if not Initiate then
		if MyTime > 5 then
			Initiate = true
			Deploy()
		else
			MyTime = MyTime+1
		end
	end
end

function onPickup(playerid)
	_PlayerSetMaxSpeed(playerid, 150)
	_PlayerEnableSprint(playerid, false)
end

function Deploy()
	_PlayerSetMaxSpeed(Owner, 150)
	_PlayerEnableSprint(Owner, false)
end

function getPrimaryShotDelay() return 4.5 end
function getPrimaryIsAutomatic() return true end
function getBulletSpread() return vector3(0.01, 0.01, 0.01) end
function getViewKick() return vector3(0.5, 0.0, 0.0) end
function getViewKickRandom() return vector3(0.5, 0.5, 0.2) end
function getNumShotsPrimary() return 1 end
function getPrimaryAmmoType() return "pistol" end
function getMaxClipPrimary()return 9999 end
function getDefClipPrimary()return 9999 end
function getTracerFreqPrimary() return 2 end
function getSecondaryIsAutomatic() return true end
function getBulletSpreadSecondary() return vector3(0.001, 0.001, 0.001) end
function getViewKickSecondary() return vector3(0.3, 0.0, 0.0) end
function getViewKickRandomSecondary() return vector3(0.2, 0.2, 0.1) end
function getNumShotsSecondary() return 1 end
function getSecondaryAmmoType() return "pistol" end
function getSecondaryShotDelay() return 1.2 end
function getMaxClipSecondary() return 9999 end
function getDefClipSecondary() return 9999 end
function getViewModel() return "models/weapons/v_rpg.mdl" end
function getWorldModel() return "models/weapons/w_rocket_launcher.mdl" end
function getClassName() return "juggernaut_cannon" end
function getHUDMaterial() return "gmod/SWEP/default" end
function getDeathIcon() return "d_rpg" end
function getWeaponSwapHands() return false end
function getWeaponFOV() return 70 end
function getWeaponSlot() return 5 end
function getWeaponSlotPos() return 2 end
function getFiresUnderwater() return true end
function getReloadsSingly() return false end
function getAnimPrefix() return "rpg" end
function getPrintName() return "Dreadnaut Cannon" end
function getPrimaryScriptOverride() return 2 end
function getSecondaryScriptOverride() return 2 end
