Ergebnis 1 bis 1 von 1

Thema: Wie Variable "lokal" speichern?

  1. #1

    Standard Wie Variable "lokal" speichern?

    Ich erstelle immoment einen neuen gamemode(Ein neuen RP Gamemode) und erstelle mir dafür auch waffen.
    Nun fehlt mir das wissen, Variablen für bestimmte Waffen zu haben(nur für diese eine Waffe und auch nur für die ID der Waffe, also so das andere gleiche waffen die variable nicht verändern können).

    Kann den code jemand so verändern, dass es wie oben beschrieben ist?
    Die Basis der Waffe ist weapon_base("base" gamemode)

    Edit: Die Variable BanTime soll so wie oben beschrieben sein


    cl_init.lua:
    Lua Code:
    1. include('shared.lua')
    2.  
    3.  
    4. SWEP.PrintName			= "Kickstick"		// 'Nice' Weapon name (Shown on HUD)	
    5. SWEP.Slot				= 0						// Slot in the weapon selection menu
    6. SWEP.SlotPos			= 10					// Position in the slot
    7. SWEP.DrawAmmo			= true					// Should draw the default HL2 ammo counter
    8. SWEP.DrawCrosshair		= true 					// Should draw the default crosshair
    9. SWEP.DrawWeaponInfoBox	= true					// Should draw the weapon info box
    10. SWEP.BounceWeaponIcon   = true					// Should the weapon icon bounce?
    11. SWEP.SwayScale			= 1.0					// The scale of the viewmodel sway
    12. SWEP.BobScale			= 1.0					// The scale of the viewmodel bob
    13.  
    14. SWEP.RenderGroup 		= RENDERGROUP_OPAQUE
    15.  
    16. // Override this in your SWEP to set the icon in the weapon selection
    17. SWEP.WepSelectIcon		= surface.GetTextureID( "weapons/swep" )
    18.  
    19. // This is the corner of the speech bubble
    20. SWEP.SpeechBubbleLid	= surface.GetTextureID( "gui/speech_lid" )
    21.  
    22. /*---------------------------------------------------------
    23. 	You can draw to the HUD here - it will only draw when
    24. 	the client has the weapon deployed..
    25. ---------------------------------------------------------*/
    26. function SWEP:DrawHUD()
    27. 	local XS = ScrW()/2 + 50
    28. 	local YS = ScrH()/2
    29.  
    30. 	draw.RoundedBox( 5, XS, YS, 50, 30, Color( 102, 102, 102, 153 ) )
    31. 	draw.DrawText( "Ban Time:", "", XS+5, YS+5, Color( 255, 255, 255, 153 ) )
    32. 	draw.DrawText( tostring(BanTime), "", XS+5, YS+5, Color( 255, 255, 255, 153 ) )
    33. end
    34.  
    35.  
    36. /*---------------------------------------------------------
    37. 	Checks the objects before any action is taken
    38. 	This is to make sure that the entities haven't been removed
    39. ---------------------------------------------------------*/
    40. function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
    41.  
    42. 	// Set us up the texture
    43. 	surface.SetDrawColor( 255, 255, 255, alpha )
    44. 	surface.SetTexture( self.WepSelectIcon )
    45.  
    46. 	// Lets get a sin wave to make it bounce
    47. 	local fsin = 0
    48.  
    49. 	if ( self.BounceWeaponIcon == true ) then
    50. 		fsin = math.sin( CurTime() * 10 ) * 5
    51. 	end
    52.  
    53. 	// Borders
    54. 	y = y + 10
    55. 	x = x + 10
    56. 	wide = wide - 20
    57.  
    58. 	// Draw that mother
    59. 	surface.DrawTexturedRect( x + (fsin), y - (fsin),  wide-fsin*2 , ( wide / 2 ) + (fsin) )
    60.  
    61. 	// Draw weapon info box
    62. 	self:PrintWeaponInfo( x + wide + 20, y + tall * 0.95, alpha )
    63.  
    64. end
    65.  
    66.  
    67. /*---------------------------------------------------------
    68. 	This draws the weapon info box
    69. ---------------------------------------------------------*/
    70. function SWEP:PrintWeaponInfo( x, y, alpha )
    71.  
    72. 	if ( self.DrawWeaponInfoBox == false ) then return end
    73.  
    74. 	if (self.InfoMarkup == nil ) then
    75. 		local str
    76. 		local title_color = "<color=230,230,230,255>"
    77. 		local text_color = "<color=150,150,150,255>"
    78.  
    79. 		str = "<font=HudSelectionText>"
    80. 		if ( self.Author != "" ) then str = str .. title_color .. "Author:</color>\t"..text_color..self.Author.."</color>\n" end
    81. 		if ( self.Contact != "" ) then str = str .. title_color .. "Contact:</color>\t"..text_color..self.Contact.."</color>\n\n" end
    82. 		if ( self.Purpose != "" ) then str = str .. title_color .. "Purpose:</color>\n"..text_color..self.Purpose.."</color>\n\n" end
    83. 		if ( self.Instructions != "" ) then str = str .. title_color .. "Instructions:</color>\n"..text_color..self.Instructions.."</color>\n" end
    84. 		str = str .. "</font>"
    85.  
    86. 		self.InfoMarkup = markup.Parse( str, 250 )
    87. 	end
    88.  
    89. 	surface.SetDrawColor( 60, 60, 60, alpha )
    90. 	surface.SetTexture( self.SpeechBubbleLid )
    91.  
    92. 	surface.DrawTexturedRect( x, y - 64 - 5, 128, 64 ) 
    93. 	draw.RoundedBox( 8, x - 5, y - 6, 260, self.InfoMarkup:GetHeight() + 18, Color( 60, 60, 60, alpha ) )
    94.  
    95. 	self.InfoMarkup:Draw( x+5, y+5, nil, nil, alpha )
    96.  
    97. end
    98.  
    99.  
    100. /*---------------------------------------------------------
    101.    Name: SWEP:FreezeMovement()
    102.    Desc: Return true to freeze moving the view
    103. ---------------------------------------------------------*/
    104. function SWEP:FreezeMovement()
    105. 	return false
    106. end
    107.  
    108.  
    109. /*---------------------------------------------------------
    110.    Name: SWEP:ViewModelDrawn()
    111.    Desc: Called straight after the viewmodel has been drawn
    112. ---------------------------------------------------------*/
    113. function SWEP:ViewModelDrawn()
    114. end
    115.  
    116.  
    117. /*---------------------------------------------------------
    118.    Name: OnRestore
    119.    Desc: Called immediately after a "load"
    120. ---------------------------------------------------------*/
    121. function SWEP:OnRestore()
    122. end
    123.  
    124. /*---------------------------------------------------------
    125.    Name: OnRemove
    126.    Desc: Called just before entity is deleted
    127. ---------------------------------------------------------*/
    128. function SWEP:OnRemove()
    129. end
    130.  
    131. /*---------------------------------------------------------
    132.    Name: CustomAmmoDisplay
    133.    Desc: Return a table
    134. ---------------------------------------------------------*/
    135. function SWEP:CustomAmmoDisplay()
    136. end
    137.  
    138. /*---------------------------------------------------------
    139.    Name: GetViewModelPosition
    140.    Desc: Allows you to re-position the view model
    141. ---------------------------------------------------------*/
    142. function SWEP:GetViewModelPosition( pos, ang )
    143.  
    144. 	return pos, ang
    145.  
    146. end
    147.  
    148. /*---------------------------------------------------------
    149.    Name: TranslateFOV
    150.    Desc: Allows the weapon to translate the player's FOV (clientside)
    151. ---------------------------------------------------------*/
    152. function SWEP:TranslateFOV( current_fov )
    153.  
    154. 	return current_fov
    155.  
    156. end
    157.  
    158.  
    159. /*---------------------------------------------------------
    160.    Name: DrawWorldModel
    161.    Desc: Draws the world model (not the viewmodel)
    162. ---------------------------------------------------------*/
    163. function SWEP:DrawWorldModel()
    164.  
    165. 	self.Weapon:DrawModel()
    166.  
    167. end
    168.  
    169.  
    170. /*---------------------------------------------------------
    171.    Name: DrawWorldModelTranslucent
    172.    Desc: Draws the world model (not the viewmodel)
    173. ---------------------------------------------------------*/
    174. function SWEP:DrawWorldModelTranslucent()
    175.  
    176. 	self.Weapon:DrawModel()
    177.  
    178. end
    179.  
    180.  
    181. /*---------------------------------------------------------
    182.    Name: AdjustMouseSensitivity()
    183.    Desc: Allows you to adjust the mouse sensitivity.
    184. ---------------------------------------------------------*/
    185. function SWEP:AdjustMouseSensitivity()
    186.  
    187. 	return nil
    188.  
    189. end
    190.  
    191. /*---------------------------------------------------------
    192.    Name: GetTracerOrigin()
    193.    Desc: Allows you to override where the tracer comes from (in first person view)
    194. 		 returning anything but a vector indicates that you want the default action
    195. ---------------------------------------------------------*/
    196. function SWEP:GetTracerOrigin()
    197.  
    198. /*
    199. 	local ply = self:GetOwner()
    200. 	local pos = ply:EyePos() + ply:EyeAngles():Right() * -5
    201. 	return pos
    202. */
    203.  
    204. end

    init.lua:
    Lua Code:
    1. AddCSLuaFile( "cl_init.lua" )
    2. AddCSLuaFile( "shared.lua" )
    3.  
    4. include( "shared.lua" )
    5.  
    6. SWEP.Weight				= 1			// Decides whether we should switch from/to this
    7. SWEP.AutoSwitchTo		= true		// Auto switch to if we pick it up
    8. SWEP.AutoSwitchFrom		= true		// Auto switch from if you pick up a better weapon
    9.  
    10. local ActIndex = {}
    11. 	ActIndex[ "pistol" ] 		= ACT_HL2MP_IDLE_PISTOL
    12. 	ActIndex[ "smg" ] 			= ACT_HL2MP_IDLE_SMG1
    13. 	ActIndex[ "grenade" ] 		= ACT_HL2MP_IDLE_GRENADE
    14. 	ActIndex[ "ar2" ] 			= ACT_HL2MP_IDLE_AR2
    15. 	ActIndex[ "shotgun" ] 		= ACT_HL2MP_IDLE_SHOTGUN
    16. 	ActIndex[ "rpg" ]	 		= ACT_HL2MP_IDLE_RPG
    17. 	ActIndex[ "physgun" ] 		= ACT_HL2MP_IDLE_PHYSGUN
    18. 	ActIndex[ "crossbow" ] 		= ACT_HL2MP_IDLE_CROSSBOW
    19. 	ActIndex[ "melee" ] 		= ACT_HL2MP_IDLE_MELEE
    20. 	ActIndex[ "slam" ] 			= ACT_HL2MP_IDLE_SLAM
    21. 	ActIndex[ "normal" ]		= ACT_HL2MP_IDLE
    22.  
    23.  
    24. /*---------------------------------------------------------
    25.    Name: SetWeaponHoldType
    26.    Desc: Sets up the translation table, to translate from normal 
    27. 			standing idle pose, to holding weapon pose.
    28. ---------------------------------------------------------*/
    29. function SWEP:SetWeaponHoldType( t )
    30.  
    31. 	local index = ActIndex[ t ]
    32.  
    33. 	if (index == nil) then
    34. 		Msg( "SWEP:SetWeaponHoldType - ActIndex[ \""..t.."\" ] isn't set!\n" )
    35. 		return
    36. 	end
    37.  
    38. 	self.ActivityTranslate = {}
    39. 	self.ActivityTranslate [ ACT_HL2MP_IDLE ] 					= index
    40. 	self.ActivityTranslate [ ACT_HL2MP_WALK ] 					= index+1
    41. 	self.ActivityTranslate [ ACT_HL2MP_RUN ] 					= index+2
    42. 	self.ActivityTranslate [ ACT_HL2MP_IDLE_CROUCH ] 			= index+3
    43. 	self.ActivityTranslate [ ACT_HL2MP_WALK_CROUCH ] 			= index+4
    44. 	self.ActivityTranslate [ ACT_HL2MP_GESTURE_RANGE_ATTACK ] 	= index+5
    45. 	self.ActivityTranslate [ ACT_HL2MP_GESTURE_RELOAD ] 		= index+6
    46. 	self.ActivityTranslate [ ACT_HL2MP_JUMP ] 					= index+7
    47. 	self.ActivityTranslate [ ACT_RANGE_ATTACK1 ] 				= index+8
    48. end
    49.  
    50. // Default hold pos is the melee
    51. SWEP:SetWeaponHoldType( "melee" )
    52.  
    53. /*---------------------------------------------------------
    54.    Name: weapon:TranslateActivity( )
    55.    Desc: Translate a player's Activity into a weapon's activity
    56. 		 So for example, ACT_HL2MP_RUN becomes ACT_HL2MP_RUN_PISTOL
    57. 		 Depending on how you want the player to be holding the weapon
    58. ---------------------------------------------------------*/
    59. function SWEP:TranslateActivity( act )
    60.  
    61. 	if ( self.Owner:IsNPC() ) then
    62. 		if ( self.ActivityTranslateAI[ act ] ) then
    63. 			return self.ActivityTranslateAI[ act ]
    64. 		end
    65. 		return -1
    66. 	end
    67.  
    68. 	if ( self.ActivityTranslate[ act ] != nil ) then
    69. 		return self.ActivityTranslate[ act ]
    70. 	end
    71.  
    72. 	return -1
    73.  
    74. end
    75.  
    76. /*---------------------------------------------------------
    77.    Name: OnRestore
    78.    Desc: The game has just been reloaded. This is usually the right place
    79. 		to call the GetNetworked* functions to restore the script's values.
    80. ---------------------------------------------------------*/
    81. function SWEP:OnRestore()
    82. end
    83.  
    84.  
    85. /*---------------------------------------------------------
    86.    Name: AcceptInput
    87.    Desc: Accepts input, return true to override/accept input
    88. ---------------------------------------------------------*/
    89. function SWEP:AcceptInput( name, activator, caller, data )
    90. 	return false
    91. end
    92.  
    93.  
    94. /*---------------------------------------------------------
    95.    Name: KeyValue
    96.    Desc: Called when a keyvalue is added to us
    97. ---------------------------------------------------------*/
    98. function SWEP:KeyValue( key, value )
    99. end
    100.  
    101.  
    102. /*---------------------------------------------------------
    103.    Name: OnRemove
    104.    Desc: Called just before entity is deleted
    105. ---------------------------------------------------------*/
    106. function SWEP:OnRemove()
    107. end
    108.  
    109. /*---------------------------------------------------------
    110.    Name: Equip
    111.    Desc: A player or NPC has picked the weapon up
    112. ---------------------------------------------------------*/
    113. function SWEP:Equip( NewOwner )
    114.  
    115. end
    116.  
    117. /*---------------------------------------------------------
    118.    Name: EquipAmmo
    119.    Desc: The player has picked up the weapon and has taken the ammo from it
    120. 		The weapon will be removed immidiately after this call.
    121. ---------------------------------------------------------*/
    122. function SWEP:EquipAmmo( NewOwner )
    123.  
    124. end
    125.  
    126.  
    127. /*---------------------------------------------------------
    128.    Name: OnDrop
    129.    Desc: Weapon was dropped
    130. ---------------------------------------------------------*/
    131. function SWEP:OnDrop()
    132.  
    133. end
    134.  
    135. /*---------------------------------------------------------
    136.    Name: ShouldDropOnDie
    137.    Desc: Should this weapon be dropped when its owner dies?
    138. ---------------------------------------------------------*/
    139. function SWEP:ShouldDropOnDie()
    140. 	return true
    141. end

    shared.lua:
    Lua Code:
    1.  
    2. // Variables that are used on both client and server
    3.  
    4. SWEP.Author			= "Xaymar"
    5. SWEP.Contact		= "perfectdeath545"
    6. SWEP.Purpose		= "Adminstick"
    7. SWEP.Instructions	= "Kick(P)/Ban(S) Stick for Admins"
    8.  
    9. SWEP.ViewModelFOV	= 62
    10. SWEP.ViewModelFlip	= false
    11. SWEP.ViewModel		= "models/weapons/v_stunstick.mdl"
    12. SWEP.WorldModel		= "models/weapons/w_stunstick.mdl"
    13. SWEP.AnimPrefix		= "python"
    14.  
    15. SWEP.Spawnable			= false
    16. SWEP.AdminSpawnable		= false
    17.  
    18. SWEP.Primary.ClipSize		= 1					// Size of a clip
    19. SWEP.Primary.DefaultClip	= 1				// Default number of bullets in a clip
    20. SWEP.Primary.Automatic		= false				// Automatic/Semi Auto
    21. SWEP.Primary.Ammo			= "Pistol"
    22.  
    23. SWEP.Secondary.ClipSize		= 1					// Size of a clip
    24. SWEP.Secondary.DefaultClip	= 1				// Default number of bullets in a clip
    25. SWEP.Secondary.Automatic	= false				// Automatic/Semi Auto
    26. SWEP.Secondary.Ammo			= "Pistol"
    27.  
    28. BanTime = 5
    29. /*---------------------------------------------------------
    30.    Name: SWEP:Initialize( )
    31.    Desc: Called when the weapon is first loaded
    32. ---------------------------------------------------------*/
    33. function SWEP:Initialize()
    34. end
    35.  
    36.  
    37. /*---------------------------------------------------------
    38.    Name: SWEP:Precache( )
    39.    Desc: Use this function to precache stuff
    40. ---------------------------------------------------------*/
    41. function SWEP:Precache()
    42. end
    43.  
    44.  
    45. /*---------------------------------------------------------
    46.    Name: SWEP:PrimaryAttack( )
    47.    Desc: +attack1 has been pressed
    48. ---------------------------------------------------------*/
    49. function SWEP:PrimaryAttack()
    50.  
    51. 	// Make sure we can shoot first
    52. 	if ( !self:CanPrimaryAttack() ) then return end
    53.  
    54. 	// Play shoot sound
    55. 	self.Weapon:EmitSound("Weapon_Stunstick.Single")
    56.  
    57.     local trace = {}
    58.     trace.start = self.Owner:GetShootPos()
    59.     trace.endpos = trace.start + (self.Owner:GetAimVector() * 150)
    60.     trace.filter = self.Owner
    61.  
    62. 	local tr = util.TraceLine(trace)
    63.     if !tr.HitNonWorld then return end
    64.     if !tr.Entity then return end
    65.  
    66. 	if tr.Entity:IsPlayer() then
    67. 		 local ply = player.GetByID( tr.Entity:EntIndex() )
    68. 		 ply:Kick("Kicked by ".. self.Owner:GetName() .."!(KickStick)" )
    69. 	end
    70. end
    71.  
    72.  
    73. /*---------------------------------------------------------
    74.    Name: SWEP:SecondaryAttack( )
    75.    Desc: +attack2 has been pressed
    76. ---------------------------------------------------------*/
    77. function SWEP:SecondaryAttack()
    78. 	local BanText = ""
    79. 	// Make sure we can shoot first
    80. 	if ( !self:CanSecondaryAttack() ) then return end
    81.  
    82. 	// Play shoot sound
    83. 	self.Weapon:EmitSound("Weapon_Stunstick.Single")
    84.  
    85.     local trace = {}
    86.     trace.start = self.Owner:GetShootPos()
    87.     trace.endpos = trace.start + (self.Owner:GetAimVector() * 150)
    88.     trace.filter = self.Owner
    89.  
    90. 	local tr = util.TraceLine(trace)
    91.     if !tr.HitNonWorld then return end
    92.     if !tr.Entity then return end
    93.  
    94. 	if tr.Entity:IsPlayer() then
    95. 		if BanTime > 0 then
    96. 			BanText = "for ".. tostring(BanTime) .." minutes"
    97. 		else
    98. 			BanText = "permanently"
    99. 		end
    100.  
    101. 		local ply = player.GetByID( tr.Entity:EntIndex() )
    102. 		ply:Ban(BanTime, "Banned by ".. self.Owner:GetName() .." ".. BanText .."!(KickStick)" )
    103. 	else
    104. 		BanTime = BanTime +5
    105. 		if BanTime > 30 then
    106. 			BanTime = 0
    107. 		end
    108. 	end
    109. end
    110.  
    111. /*---------------------------------------------------------
    112.    Name: SWEP:CheckReload( )
    113.    Desc: CheckReload
    114. ---------------------------------------------------------*/
    115. function SWEP:CheckReload()
    116.  
    117. end
    118.  
    119. /*---------------------------------------------------------
    120.    Name: SWEP:Reload( )
    121.    Desc: Reload is being pressed
    122. ---------------------------------------------------------*/
    123. function SWEP:Reload()
    124.  
    125. end
    126.  
    127.  
    128. /*---------------------------------------------------------
    129.    Name: SWEP:Think( )
    130.    Desc: Called every frame
    131. ---------------------------------------------------------*/
    132. function SWEP:Think()
    133. end
    134.  
    135.  
    136. /*---------------------------------------------------------
    137.    Name: SWEP:Holster( weapon_to_swap_to )
    138.    Desc: Weapon wants to holster
    139.    RetV: Return true to allow the weapon to holster
    140. ---------------------------------------------------------*/
    141. function SWEP:Holster( wep )
    142. 	return true
    143. end
    144.  
    145. /*---------------------------------------------------------
    146.    Name: SWEP:Deploy( )
    147.    Desc: Whip it out
    148. ---------------------------------------------------------*/
    149. function SWEP:Deploy()
    150. 	return true
    151. end
    152.  
    153.  
    154. /*---------------------------------------------------------
    155.    Name: SWEP:ShootBullet( )
    156.    Desc: A convenience function to shoot bullets
    157. ---------------------------------------------------------*/
    158. function SWEP:ShootEffects()
    159.  
    160. 	self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) 		// View model animation
    161. 	self.Owner:MuzzleFlash()								// Crappy muzzle light
    162. 	self.Owner:SetAnimation( PLAYER_ATTACK1 )				// 3rd Person Animation
    163.  
    164. end
    165.  
    166.  
    167. /*---------------------------------------------------------
    168.    Name: SWEP:ShootBullet( )
    169.    Desc: A convenience function to shoot bullets
    170. ---------------------------------------------------------*/
    171. function SWEP:ShootBullet( damage, num_bullets, aimcone )
    172.  
    173. 	local bullet = {}
    174. 	bullet.Num 		= num_bullets
    175. 	bullet.Src 		= self.Owner:GetShootPos()			// Source
    176. 	bullet.Dir 		= self.Owner:GetAimVector()			// Dir of bullet
    177. 	bullet.Spread 	= Vector( aimcone, aimcone, 0 )		// Aim Cone
    178. 	bullet.Tracer	= 5									// Show a tracer on every x bullets 
    179. 	bullet.Force	= 1									// Amount of force to give to phys objects
    180. 	bullet.Damage	= damage
    181. 	bullet.AmmoType = "Pistol"
    182.  
    183. 	self.Owner:FireBullets( bullet )
    184.  
    185. 	self:ShootEffects()
    186.  
    187. end
    188.  
    189.  
    190. /*---------------------------------------------------------
    191.    Name: SWEP:TakePrimaryAmmo(   )
    192.    Desc: A convenience function to remove ammo
    193. ---------------------------------------------------------*/
    194. function SWEP:TakePrimaryAmmo( num )
    195.  
    196. 	// Doesn't use clips
    197. 	if ( self.Weapon:Clip1() <= 0 ) then 
    198.  
    199. 		if ( self:Ammo1() <= 0 ) then return end
    200.  
    201. 		self.Owner:RemoveAmmo( num, self.Weapon:GetPrimaryAmmoType() )
    202.  
    203. 	return end
    204.  
    205. 	self.Weapon:SetClip1( self.Weapon:Clip1() - num )	
    206.  
    207. end
    208.  
    209.  
    210. /*---------------------------------------------------------
    211.    Name: SWEP:TakeSecondaryAmmo(   )
    212.    Desc: A convenience function to remove ammo
    213. ---------------------------------------------------------*/
    214. function SWEP:TakeSecondaryAmmo( num )
    215.  
    216. 	// Doesn't use clips
    217. 	if ( self.Weapon:Clip2() <= 0 ) then 
    218.  
    219. 		if ( self:Ammo2() <= 0 ) then return end
    220.  
    221. 		self.Owner:RemoveAmmo( num, self.Weapon:GetSecondaryAmmoType() )
    222.  
    223. 	return end
    224.  
    225. 	self.Weapon:SetClip2( self.Weapon:Clip2() - num )	
    226.  
    227. end
    228.  
    229.  
    230. /*---------------------------------------------------------
    231.    Name: SWEP:CanPrimaryAttack( )
    232.    Desc: Helper function for checking for no ammo
    233. ---------------------------------------------------------*/
    234. function SWEP:CanPrimaryAttack()
    235. 	return true
    236. end
    237.  
    238.  
    239. /*---------------------------------------------------------
    240.    Name: SWEP:CanSecondaryAttack( )
    241.    Desc: Helper function for checking for no ammo
    242. ---------------------------------------------------------*/
    243. function SWEP:CanSecondaryAttack()
    244. 	return true
    245. end
    246.  
    247.  
    248. /*---------------------------------------------------------
    249.    Name: ContextScreenClick(  aimvec, mousecode, pressed, ply )
    250. ---------------------------------------------------------*/
    251. function SWEP:ContextScreenClick( aimvec, mousecode, pressed, ply )
    252. end
    253.  
    254.  
    255. /*---------------------------------------------------------
    256.    Name: OnRemove
    257.    Desc: Called just before entity is deleted
    258. ---------------------------------------------------------*/
    259. function SWEP:OnRemove()
    260. end
    261.  
    262.  
    263. /*---------------------------------------------------------
    264.    Name: OwnerChanged
    265.    Desc: When weapon is dropped or picked up by a new player
    266. ---------------------------------------------------------*/
    267. function SWEP:OwnerChanged()
    268. end
    269.  
    270.  
    271. /*---------------------------------------------------------
    272.    Name: Ammo1
    273.    Desc: Returns how much of ammo1 the player has
    274. ---------------------------------------------------------*/
    275. function SWEP:Ammo1()
    276. 	return self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() )
    277. end
    278.  
    279.  
    280. /*---------------------------------------------------------
    281.    Name: Ammo2
    282.    Desc: Returns how much of ammo2 the player has
    283. ---------------------------------------------------------*/
    284. function SWEP:Ammo2()
    285. 	return self.Owner:GetAmmoCount( self.Weapon:GetSecondaryAmmoType() )
    286. end
    287.  
    288. /*---------------------------------------------------------
    289.    Name: SetDeploySpeed
    290.    Desc: Sets the weapon deploy speed. 
    291. 		 This value needs to match on client and server.
    292. ---------------------------------------------------------*/
    293. function SWEP:SetDeploySpeed( speed )
    294. 	self.m_WeaponDeploySpeed = tonumber( speed )
    295. end
    Geändert von CGamer (23.09.2009 um 16:42 Uhr) Grund: was vergessen:P

Ähnliche Themen

  1. Antworten: 34
    Letzter Beitrag: 06.08.2009, 20:54
  2. Gebaute "Dinge" speichern?
    Von Schoko im Forum Hilfe & Support
    Antworten: 1
    Letzter Beitrag: 15.12.2008, 10:11
  3. Wiremod Speichern bspw "Coler" ?
    Von Skyanlone im Forum Addon: Wiremod
    Antworten: 12
    Letzter Beitrag: 26.06.2008, 16:36

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •