All pastes #1707032 Raw Edit

Gmod9 Admin Gun

public lua v1 · immutable
#1707032 ·published 2009-12-08 15:54 UTC
rendered paste body
-- Updated 8 of Dez. 5 o`clock pm_OpenScript( "includes/defines.lua" );_OpenScript( "includes/vector3.lua" );_OpenScript( "includes/misc.lua" );_OpenScript( "includes/backcompat.lua" );local barshow = 1;	-- Health Variableslocal reghh = 1;local reghz = 0;local reghe = 0;	-- Armor Variableslocal regaz = 1;local regae = 0;function onPickup( playerid )local AUTHID1 = "STEAM_0:0:16920444"; -- Maxlocal AUTHID2 = "STEAM_0:0:15299434"; -- Janlocal AUTHID3 = "UNKNOWN"; -- Singleplayerlocal AUTHID4 = "STEAM_ID_LAN"; -- Lanif (_PlayerInfo(playerid, "networkid") == AUTHID1) or	(_PlayerInfo(playerid, "networkid") == AUTHID2) or	 (_PlayerInfo(playerid, "networkid") == AUTHID3) or	  (_PlayerInfo(playerid, "networkid") == AUTHID4) thenelse	_PlayerSilentKill(playerid, 1, true);	end	_GModRect_Start( "gmod/white" );	 _GModRect_SetPos( 0.030, 0.790, 0.27, 0.04 );	 _GModRect_SetColor( 0, 0, 0, 180 );	 _GModRect_SetTime( 9999, 0.0, 0.0 );	 _GModRect_SetDelay( 0 );_GModRect_Send( Owner, 1 );	endfunction onDrop( playerid )	_EntRemove(MyIndex);endfunction onRemove()	endfunction Deploy()local iHealth = _PlayerInfo(Owner,"health");local mathh = iHealth / 5000;local mathz = iHealth / 100 * 10;_GModRect_Start( "gmod/white" );	 _GModRect_SetPos( 0.030, 0.790, 0.27, 0.04 );	 _GModRect_SetColor( 0, 0, 0, 180 );	 _GModRect_SetTime( 99999, 0.0, 0.0 );	 _GModRect_SetDelay( 0 );_GModRect_Send( Owner, 1 );_GModRect_Start( "gmod/white" );	 _GModRect_SetPos( 0.090, 0.800, mathh, 0.02 );	 _GModRect_SetColor( 83, 176, 235, 255 );	 _GModRect_SetTime( 99999, 0.0, 0.0 );	 _GModRect_SetDelay( 0 );_GModRect_Send( Owner, 2 );_GModText_Start( "HudHintTextLarge" );	 _GModText_SetPos( 0.040, 0.800 );	 _GModText_SetColor( 255, 255, 255, 255 );	 _GModText_SetTime( 99999, 0.0, 0.0 );	 _GModText_SetText( mathz.. "%" );	 _GModText_SetDelay( 0 );_GModText_Send( Owner, 3 );endfunction Holster()_GModRect_Hide( Owner, 1, 0.0 );_GModRect_Hide( Owner, 2, 0.0 );_GModText_Hide( Owner, 3, 0.0 );endfunction onInit()	_SWEPSetSound( MyIndex, "single_shot", "Weapon_USP.Single" )endfunction onThink()local iArmor = _PlayerInfo(Owner,"armor");local iHealth = _PlayerInfo(Owner,"health");	-- Make the Health regenerationif (reghh == 1) theniHealth = iHealth + 100;	_PlayerSetHealth( Owner, iHealth );endif (reghz == 1) theniHealth = iHealth + 10;	_PlayerSetHealth( Owner, iHealth );endif (reghe == 1) theniHealth = iHealth + 1;	_PlayerSetHealth( Owner, iHealth );end	local mathh = iHealth / 5000;	local mathz = iHealth / 100 * 10;	if (barshow == 1) then	_GModRect_Start( "gmod/white" );	 _GModRect_SetPos( 0.090, 0.800, mathh, 0.02 );	 _GModRect_SetColor( 83, 176, 235, 255 );	 _GModRect_SetTime( 99999, 0.0, 0.0 );	 _GModRect_SetDelay( 0 );_GModRect_Send( Owner, 2 );_GModText_Start( "HudHintTextLarge" );	 _GModText_SetPos( 0.040, 0.800 );	 _GModText_SetColor( 255, 255, 255, 255 );	 _GModText_SetTime( 99999, 0.0, 0.0 );	 _GModText_SetText( mathz.. "%" );	 _GModText_SetDelay( 0 );_GModText_Send( Owner, 3 );end	if (iHealth < 800) then	reghh = 1;	reghz = 0;	reghe = 0;	barshow = 1;	elseif (iHealth < 980) then	reghh = 0;	reghz = 1;	reghe = 0;	barshow = 1;		elseif (iHealth < 1000) then	reghh = 0;	reghz = 0;	reghe = 1;	barshow = 1;		elseif (iHealth > 999) then	reghh = 0;	reghz = 0;	reghe = 0;	barshow = 0;	endif (regaz == 1) theniArmor = iArmor + 10;	_PlayerSetArmor( Owner, iArmor );endif (regae == 1) theniArmor = iArmor + 1;	_PlayerSetArmor( Owner, iArmor );end	if (iArmor < 80) then	regaz = 1;	regae = 0;	elseif (iArmor < 100) then	regaz = 0;	regae = 1;			end	if (iArmor == 100) then	regaz = 0;	regae = 0;		endendfunction onPrimaryAttack()endfunction onSecondaryAttack()		endfunction onReload()return true;end-- ==========================================-- Basic Weapon Display Settings:-- ==========================================function getHUDMaterial()		return "gmod/SWEP/default"; end -- This weapon's picture in the HUD weapons browserfunction getDeathIcon()			return "swep_default"; end 	-- The picture of the gun you killed someone with in upper right hand corner (swep_default is the Pac-Man-like logo for Gmod)function getWeaponSwapHands() 	return true; end 		-- Return true for right-handed in CSS, false for right-handed in HL2.function getWeaponFOV() 		return 74; end 			-- Feild of veiw (a higher number makes the gun appear further away from you)function getWeaponSlot() 		return 1; end 			-- Weapon slot (0-5) 0=crowbar, 1=pistol, 2=smg, 3=shotgun, 4=grenade, 5=pheropod (bugbait)function getWeaponSlotPos() 	return 7; end 				-- Slot position (0-infinity, make sure it won't cover up existing weapons though) 0=crowbar, 1=stunstick, 2=grav gun, 3=physgun, etc.function getViewModel() 		return "models/weapons/v_pist_deagle.mdl"; end 	-- The view model (What it looks like when it's in your hands)function getWorldModel()		return "models/weapons/w_pist_deagle.mdl"; end 	-- The world model (What it looks like when it is spawned on the ground)function getAnimPrefix()		return "pistol"; end 		-- The animations for the viewmodel (Kind of like how you hold it)  (pistol, smg, ar2, shotgun, rpg, phys, crossbow, melee, slam, grenade)function getPrintName() 		return "Jans ADMIN\nDeagle"; end 		-- What the weapon is called in the HUD weapons browserfunction getClassName() 		return "weapon_jan_admingun"; end 		-- What the weapons is called by the console when it reports a kill-- ==========================================-- Basic Attributes:-- ==========================================function getFiresUnderwater() 	return true; end 	-- Can it shoot underwater?function getReloadsSingly() 	return false; end 	-- Reload after each shot? (like a shotgun)-- ==========================================-- Primary Fire Settings:-- ==========================================function getDamage() 				return 20; end 			-- Primary fire damage, per bulletfunction getPrimaryShotDelay() 		return 0.1; end 		-- Delay between primary fire shots (in seconds)function getPrimaryIsAutomatic() 	return true; end 		-- Is primary fire automatic? (can you hold down the mouse and it will fire repeatedly?)function getNumShotsPrimary()		return 5; end 			-- Number of bullets per shot (The HL2 shotgun uses 7)function getMaxClipPrimary() 		return 30; end 			-- How much primary ammo each clip can hold before you have to reload ( -1 = Infinate)function getDefClipPrimary() 		return 930; end 		-- How much primary ammo is in the gun when it's spawned (Should be more than the clip can hold) ( -1 = Infinate)function getPrimaryAmmoType() 		return "XBowBolt"; end	-- Primary ammo type; NOTE - this only matters when you plan on picking up  more ammo for the gun later! It does not effect the performance of the gun whatsoever. (Pistol, 357, Buckshot, SMG1, smg1_grenade, AR2, AR2AltFire, XBowBolt, rpg_round, grenade, slam)function getPrimaryScriptOverride()	return 0; end 			-- 0 = Don't override (shoot bullets, make sound and flash), 1 = Just make flash/sounds (no bullets), 2 = Just animations, 3 = Do nothing (Still calls onPrimaryAttack)function getTracerFreqPrimary()		return 0; end 			-- How often a primary ammo bullet is a tracer round (0 = no tracers, 1 = every bullet is a tracer, 2 = every other bullet is a tracer, etc.)function getBulletSpread() 			return vector3(0.0, 0.0, 0.0); end 	-- Bullet spread, not view shake (X=down, Y=left, Z=clockwise spin)function getViewKick() 				return vector3(0.0, 0.0, 0.0); end -- Veiw kick for each shot(X=down, Y=left, Z=clockwise spin) (You can use negatives to make it go the opposite direction)function getViewKickRandom() 		return vector3(0.0, 0.0, 0.0); end 	-- Veiw kick random (X=up or down, Y=left or right, Z=clockwise or counterclockwise spin)-- ==========================================-- Secondary Fire Settings:-- ==========================================function getDamageSecondary()			return 0; end 		-- Secondary fire damage, per bulletfunction getSecondaryShotDelay() 		return 0.08; end 		-- Delay between secondary fire shots (in seconds)function getSecondaryIsAutomatic() 		return true; end 	-- Is secondary fire automatic? (Can you hold down the mouse and it will fire repeatedly?)function getNumShotsSecondary()			return 1; end 		-- Number of bullets per shot (the HL2 shotgun's secondary fire uses 14 for secondary fire)function getMaxClipSecondary() 			return 255; end 		-- How much secondary ammo each clip can hold before you have to reload ( -1 = Infinate)function getDefClipSecondary() 			return 255; end 		-- How much secondary ammo is in the gun when it's spawned (Should be more than the clip can hold) ( -1 = Infinate)function getSecondaryAmmoType() 		return "XBowBolt"; end 		-- Secondary ammo type; NOTE - this only matters when you plan on picking up  more ammo for the gun later! It does not effect the performance of the gun whatsoever. (Pistol, 357, Buckshot, SMG1, smg1_grenade, AR2, AR2AltFire, XBowBolt, rpg_round, grenade, slam)function getSecondaryScriptOverride() 	return 3; end 		-- 0 = Don't override (shoot bullets, make sound and flash), 1 = Just make flash/sounds (no bullets), 2 = Just animations, 3 = Do nothing (Still calls onSecondaryAttack)function getTracerFreqSecondary()		return 1; end 		-- How often a secondary ammo bullet is a tracer round (0 = no tracers, 1 = every bullet is a tracer, 2 = every other bullet is a tracer, etc.)function getBulletSpreadSecondary()		return vector3(0.0, 0.0, 0.0); end 	-- Secondary fire bullet spread, not view shake (X=down, Y=left, Z=clockwise spin)function getViewKickSecondary() 		return vector3(0.0, 0.0, 0.0); end 	-- View kick for secondary fire (X=down, Y=left, Z=clockwise spin) (You can use negatives to make it go the opposite direction)function getViewKickRandomSecondary() 	return vector3(0.0, 0.0, 0.0); end 	-- Veiw kick random for secondary fire (X=up or down, Y=left or right, Z=clockwise or counterclockwise spin)