Swep Hud Icons

Ok, so I’ve seen a lot of weapons that have a “HUD Icon” (by that i mean the Icon that starts jumping for some sweps in the hud menu). My question is: How do I add my own custom? Now I’ve been over the Haax Swep, but I can only change the Icon for the Haax Swep. Doesn’t work on other sweps probably because of base (not sure). I have noticed that most of the sweps have CSS weapon Icons. Now I recently started to code a new gamemode and i came to the swep section. I already made icons but I have no clue how to import them. If anybody can help i would appreciate it. Thanks in advance!

[lua]SWEP.WepSelectIcon = surface.GetTextureID(“weapons/myicon”) [/lua]

After you convert the icon to vtf form and place the vtf and vmt into weapons/myicon in materials/

Good luck :biggrin:

Ok, so where do I put this? lol… In my Base code, or in my cl_init? (I actually tried in both and they still don’t show up. But only when I put it in cl_init the weapon actually spawns without problems, yet the icon still doesnt show up. I tried SWEP.WepSelectIcon = surface.GetTextureID(“weapons/barrett”), because my icon is in materials\weapons and there is the files Barrett.vtf and Barrett.vtm)

Logic tells me icons are clientside.

True they are, I tried. But the CSS Sniper icon keeps showing up. I think it has to be disabled. I am fully sure I did everything right

The file is vmt, not vtm, and you have to make sure it has the same properties as the other CS:S icons in the vmt and vtf.

ah its not a custom icon, dont you get that already? Bahh, i hear good things about this forum, yet no help in result .Thanks a lot…

No, thank you. I obviously didn’t understand that them icons you made weren’t custom. :downs:

I think its trying to tell us he wants to replace the Counter Strike weapons icons.

:geno:

He made icons that he wants to use instead of the Counter Strike icons then Idk

[editline]06:02PM[/editline]

oh NOW i know what he wants!!

Some weapons have those bouncy icons when you press the menu button they are in
(1 for crowbar, grav gun, physgun,; 2 for…) and when you have a custom weapon it has a bouncy lua file as an icon. He wants to make his own.

:geno:

[editline]12:04PM[/editline]

Just put [lua]SWEP.WepSelectIcon = surface.GetTextureID(“weapons/myicon”)[/lua] anywhere in your SWEPs shared.lua file…

yes, that is exactly what i want! But that Command doesn’t work. Basicly I’m Screwed

Yes I tried that. It doesn’t work. Now that everybody knows what my problem is…help? lol

Edit : Who is this guy’s problem? I’m having a serious issue here and he is rating me with Dumb Ratings…

Dumb ratings mean they love you.
If it isn’t working then re-install Garry’s Mod or BUY it because you might be a…
:yarr:Pirate?:yarr:

God, people. I’m not a fucking pirate. When I enter the line and the path to my icon the swep is becomes unspawnable! Now can I get some real help or not?

Yes you could get some real help if you went ahead and posted the SWEP code.

No one’s giving you “fake” help. I gave you all you needed to know, it’s a simple copy and paste. If it becomes unspawnable, tell us the error instead of blaming it on the people who are trying to help you. Here’s a tip, trying to degrade people who are trying to help you will get you a one way free ticket to no help at all. :geno:

Eh, I’m not seeing any help actually. But you do need to post the code so we can take a look at it.

This, very much.
If you’re going to call us idiots we aren’t going to help. Gb gave you the code, give us the error.

There is no error. I even checked the console with developer on. Anyways here is my code:

[lua]if SERVER then

AddCSLuaFile("shared.lua")
SWEP.HoldType = "ar2"

end

if CLIENT then

SWEP.DrawAmmo			= true
SWEP.DrawCrosshair		= false
SWEP.ViewModelFOV		= 76
SWEP.ViewModelFlip		= true
SWEP.CSMuzzleFlashes	= true
	
SWEP.Slot				= 3
SWEP.SlotPos			= 1
SWEP.IconLetter			= "i"
SWEP.DrawWeaponInfoBox  = true

killicon.AddFont("weapon_rg_example", "CSKillIcons", SWEP.IconLetter, Color(255, 220, 0, 255))

end

SWEP.WepSelectIcon = surface.GetTextureID(“weapons/barrett”)
SWEP.Base = “rg_base”
SWEP.Category = “Call Of Duty: Modern Warfare 2”


– Info –

SWEP.PrintName = “Barrett 50.cal”
SWEP.Author = “Jackthemaster”
SWEP.Purpose = “Blow peoples limbs off.”
SWEP.Instructions = “Pull trigger.”


– Misc. –

SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false


– Primary Fire –

SWEP.Primary.Sound = Sound(“awp.wav”)
SWEP.Primary.Damage = 200 – This determines both the damage dealt and force applied by the bullet.
SWEP.Primary.NumShots = 1
SWEP.Primary.ClipSize = 8
SWEP.Primary.DefaultClip = 16
SWEP.Primary.Ammo = “smg1”
SWEP.MuzzleVelocity = 1200 – How fast the bullet travels in meters per second. For reference, an AK47 shoots at about 750, an M4 shoots at about 900, and a Luger 9mm shoots at about 350 (source: Wikipedia)
SWEP.FiresUnderwater = true


– Secondary Fire –

– Secondary Fire is used to switch ironsights and firemodes
SWEP.Secondary.ClipSize = -1 – best left at -1
SWEP.Secondary.DefaultClip = 1 – set to -1 if you don’t use secondary ammo
SWEP.Secondary.Ammo = “none” – Leave this if you want your SWEP to have grenades, otherwise set to “none” if you don’t use secondary ammo.


– Recoil, Spread, and Spray –

SWEP.RecoverTime = 0.8 – Time in seconds it takes the player to re-steady his aim after firing.

– The following variables control the overall accuracy of the gun and typically increase with each shot
– Recoil: how much the gun kicks back the player’s view.
SWEP.MinRecoil = 0.5
SWEP.MaxRecoil = 5
SWEP.DeltaRecoil = 1 – The recoil to add each shot. Same deal for spread and spray.

– Spread: the width of the gun’s firing cone. More spread means less accuracy.
SWEP.MinSpread = 0.001
SWEP.MaxSpread = 0.05
SWEP.DeltaSpread = 0.001

– Spray: the gun’s tendancy to point in random directions. More spray means less control.
SWEP.MinSpray = 0
SWEP.MaxSpray = 1.4
SWEP.DeltaSpray = 0.16


– Ironsight/Scope –

– IronSightsPos and IronSightsAng are model specific paramaters that tell the game where to move the weapon viewmodel in ironsight mode.
SWEP.IronSightsPos = Vector(5.2, -5.8, 2) – Comment out this line of you don’t want ironsights. This variable must be present if your SWEP is to use a scope.
SWEP.IronSightsAng = Vector(2.8, 0, 0)
SWEP.IronSightZoom = 2.3 – How much the player’s FOV should zoom in ironsight mode.
SWEP.UseScope = true – Use a scope instead of iron sights.
SWEP.ScopeScale = 0.4 – The scale of the scope’s reticle in relation to the player’s screen size.
SWEP.ScopeZooms = {4,8,16} – The possible magnification levels of the weapon’s scope. If the scope is already activated, secondary fire will cycle through each zoom level in the table.
SWEP.DrawParabolicSights = true – Set to true to draw a cool parabolic sight (helps with aiming over long distances)


– Effects/Visual –

SWEP.ViewModel = “models/weapons/v_snip_hex.mdl”
SWEP.WorldModel = “models/weapons/w_snip_awp.mdl”

SWEP.MuzzleEffect = “rg_muzzle_rifle” – This is an extra muzzleflash effect
– Available muzzle effects: rg_muzzle_grenade, rg_muzzle_highcal, rg_muzzle_hmg, rg_muzzle_pistol, rg_muzzle_rifle, rg_muzzle_silenced, none

SWEP.ShellEffect = “rg_shelleject_rifle” – This is a shell ejection effect
– Available shell eject effects: rg_shelleject, rg_shelleject_rifle, rg_shelleject_shotgun, none

SWEP.MuzzleAttachment = “1” – Should be “1” for CSS models or “muzzle” for hl2 models
SWEP.ShellEjectAttachment = “2” – Should be “2” for CSS models or “1” for hl2 models


– Modifiers –

– Modifiers scale the gun’s recoil, spread, and spray based on the player’s stance
SWEP.CrouchModifier = 0.7 – Applies if player is crouching.
SWEP.IronSightModifier = 0.7 – Applies if player is in iron sight mode.
SWEP.RunModifier = 1.4 – Applies if player is moving.
SWEP.JumpModifier = 1.6 – Applies if player is in the air (jumping)[/lua]