All pastes #173010 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-09-16 13:34 UTC
rendered paste body
--StayUpright

entid = nil
angle = nil

-- Called when the weapon is created.

	function onInit( )
	end
	
	
-- Called when player picks up weapon
	function onPickup( playerid )
	end
	
	
-- Called when player drops weapon
	function onDrop( playerid )
	end


-- Weapon is about to be destroyed.
	function onRemove( )
	end


-- Called every frame

	function onThink( )
		EntSetAng(entid,angle)
	end
	

-- When the player presses left mouse button

	function onPrimaryAttack( )	
		_TraceLine(_PlayerGetShootPos(Owner),_PlayerGetShootAng(Owner),4096,Owner)
		entid=_TraceGetEnt()
		angle=EntGetAng(entid)
	end

	

-- When the player presses right mouse button

	function onSecondaryAttack( )		
	end


-- When Weapon is swapped to

	function Deploy( )
	end
	
	
-- When weapon swapped away from
	
	function Holster( )
	end
	

-- When player presses reload. Returning false means DON'T RELOAD. Although this will hitch on the client.

	function onReload( )
		return true;
	end



-- Primary Attack Settings

	function getDamage()
		return 10;
	end

	function getPrimaryShotDelay()
		return 0.2;
	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 -1 if it doesn't use clips
		return 25;
	end
	
	function getDefClipPrimary() -- ammo in gun by default
		return 25;
	end
	
	function getTracerFreqPrimary() -- 0 = none, 1 = every bullet, 2 = every 2nd bullet etc
		return 2;
	end
	
	
-- Secondary attack Settings

	function getDamageSecondary()
		return 10;
	end

	function getSecondaryShotDelay()
		return 0.2;
	end

	function getSecondaryIsAutomatic()
		return false;
	end

	function getBulletSpreadSecondary()
		return vector3( 0.001, 0.001, 0.001 );
	end

	function getViewKickSecondary()
		return vector3( 0.5, 0.0, 0.0);
	end

	function getViewKickRandomSecondary()
		return vector3( 0.5, 0.5, 0.2 );
	end

	function getNumShotsSecondary()
		return 1;
	end

	function getSecondaryAmmoType()
		return "pistol";
	end

	function getMaxClipSecondary() -- return -1 if it doesn't use clips
		return -1;
	end

	function getDefClipSecondary()
		return 0;
	end
	
	function getTracerFreqSecondary()
		return 2;
	end
	
	
	
	
-- Weapon Configuration
	
	function getViewModel( )
		return "models/weapons/v_smg_ump45.mdl";
	end

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

	function getClassName() 
		return "weapon_scripted";
	end

	function getHUDMaterial( )
		return "gmod/SWEP/default";
	end

	function getDeathIcon( )
		return "swep_default";
	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
	
	-- How the player model holds the weapon: 
	-- pistol, smg, ar2, shotgun, rpg, phys, crossbow, melee, slam, grenade
	function getAnimPrefix() 
		return "shotgun";
	end

	function getPrintName()
		return "The Boltgun";
	end

	-- 0 = Don't override, shoot bullets, make sound and flash
	-- 1 = Don't shoot bullets but do make flash/sounds
	-- 2 = Only play animations
	-- 3 = Don't do anything
	function getPrimaryScriptOverride()
		return 0;
	end

	function getSecondaryScriptOverride()
		return 0;
	end