function GetScopeTex()
	local cur_r_TexResolution = tonumber( getglobal( "r_TexResolution" ) );
	if( cur_r_TexResolution >= 2 ) then -- lower res texture for low texture quality setting
		return System:LoadImage("Textures/Hud/crosshair/OICW_Scope_low.dds");
	else
		return System:LoadImage("Textures/Hud/crosshair/OICW_Scope.dds");
	end
end


OICW = {
	name			= "OICW",
	object		= "Objects/Weapons/oicw/oicw_bind.cgf",
	character	= "Objects/Weapons/oicw/oicw.cgf",

	-- if the weapon supports zooming then add this...
	ZoomActive = 0,												-- initially always 0
	MaxZoomSteps = 1,
	ZoomSteps = { 3 },
	AimMode=1,														--does this allow zoom while moving or removing crosshair
	---------------------------------------------------
	PlayerSlowDown = 0.9,									-- mod 0.8 to 0.9 factor to slow down the player when he holds that weapon
	---------------------------------------------------
	ActivateSound = Sound:LoadSound("Sounds/Weapons/oicw/oicwact.wav",0,155),	-- sound to play when this weapon is selected
	ZoomNoSway=1,
	---------------------------------------------------
	DrawFlare=1,
	---------------------------------------------------
	FireParams ={													-- describes all supported firemodes
	
	{
		--no_zoom = 0,								--mod to allow zoom					
		FModeActivationTime=1,
		HasCrosshair=1,								
		AmmoType="Assault",
		projectile_class="PhotonB",
		ammo=500,
		reload_time=2.2,							--mod
		fire_rate=1.0,
		--fire_activation=FireActivation_OnPress,
		fire_activation=bor(FireActivation_OnPress,FireActivation_OnHold),	--mod added
		bullet_per_shot=1,
		bullets_per_clip=50,					--mod

		FireSounds = {
			"Sounds/Weapons/S500/photon2_mono.wav",							--mod firing sounds
			"Sounds/Weapons/S500/photon2_mono.wav",
			"Sounds/Weapons/S500/photon2_mono.wav",
		},
		FireSoundsStereo = {
			"Sounds/Weapons/S500/photon2_stereo.wav",						--mod firing sounds
			"Sounds/Weapons/S500/photon2_stereo.wav",
			"Sounds/Weapons/S500/photon2_stereo.wav",
		},
		DrySound = "Sounds/Weapons/S500/dryfire1.wav",

		ScopeTexId = GetScopeTex(),						--mod added to get same sights as primary
		
		MuzzleFlash = {
			geometry_name = "Objects/Weapons/Muzzle_flash/mf_DE_fpv.cgf",
			bone_name = "spitfire",
			lifetime = 0.05,
		},

		LightFlash = {
			fRadius = 3.0,
			vDiffRGBA = { r = 1.0, g = 1.0, b = 0.7, a = 1.0, },
			vSpecRGBA = { r = 1.0, g = 1.0, b = 0.7, a = 1.0, },
			fLifeTime = 0.1,
		},

		SoundMinMaxVol = { 255, 4, 2600 },
	},
	

{
		no_zoom = 1,
		FModeActivationTime=1,
		HasCrosshair=1,
		AmmoType="OICWGrenade",
		projectile_class="AMGrenade",
		ammo=500,
		reload_time=3.6,				--mod to 3.6, cannot have too many of these going off together
		fire_rate=1.0,
		fire_activation=FireActivation_OnPress,
		bullet_per_shot=1,
		bullets_per_clip=1,

		FireSounds = {
			"Sounds/Weapons/OICW/FINAL_OICW_MONO_GRENADE.wav",
			"Sounds/Weapons/OICW/FINAL_OICW_MONO_GRENADE.wav",
			"Sounds/Weapons/OICW/FINAL_OICW_MONO_GRENADE.wav",
		},
		FireSoundsStereo = {
			"Sounds/Weapons/OICW/FINAL_OICW_STEREO_GRENADE.wav",
			"Sounds/Weapons/OICW/FINAL_OICW_STEREO_GRENADE.wav",
			"Sounds/Weapons/OICW/FINAL_OICW_STEREO_GRENADE.wav",
		},
		DrySound = "Sounds/Weapons/AG36/DryFire.wav",

		LightFlash = {
			fRadius = 3.0,
			vDiffRGBA = { r = 1.0, g = 1.0, b = 0.7, a = 1.0, },
			vSpecRGBA = { r = 1.0, g = 1.0, b = 0.7, a = 1.0, },
			fLifeTime = 0.1,
		},

		SoundMinMaxVol = { 255, 4, 2600 },
	}



	

	},

		SoundEvents={
		--	animname,	frame,	soundfile												---
		{	"reload1",	14,			Sound:LoadSound("Sounds/Weapons/OICW/oicwB_14.wav",0,155)},
		{	"reload1",	32,			Sound:LoadSound("Sounds/Weapons/OICW/oicwB_32.wav",0,155)},
		{	"reload2",	32,			Sound:LoadSound("Sounds/Weapons/OICW/oicwG_32.wav",0,155)},
		{	"reload2",	48,			Sound:LoadSound("Sounds/Weapons/OICW/oicwG_48.wav",0,155)},
--		{	"swim",		1,				Sound:LoadSound("Sounds/player/water/underwaterswim2.wav",0,255)},

	},
}

CreateBasicWeapon(OICW);								

---------------------------------------------------------------
--ANIMTABLE
------------------
OICW.anim_table={}											 
--AUTOMATIC FIRE
OICW.anim_table[1]={										
	idle={
		"Idle11",
		"Idle21",
	},
	reload={
		"Reload1",
	},
	fire={
		"Fire11",
		"Fire21",
	},
	melee={
		"Fire23",
	},
	swim={
		"swim",
	},
	activate={
		"Activate1",
	},
}

--AUTOMATIC FIRE
OICW.anim_table[2]={
	idle={
		"Idle21",
		"Idle22",
	},
	reload={
		"Reload2",
	},
	fire={
		"Fire12",
	},
	melee={
		"Fire23",
	},
	swim={
		"swim",
	},
	activate={
		"Activate1",
	},
}