DrawAmmo

I’m having some trouble with SWEP.DrawAmmo. Right now I have it set to false, but it still draws it.



if (CLIENT) then
 
 
    SWEP.PrintName = "Rocket Hurling Device";
    SWEP.Slot = 4;
    SWEP.SlotPos = 1;
    SWEP.DrawAmmo = false;
    SWEP.DrawCrosshair = true;
    SWEP.Author = "Matt";
    SWEP.Contact = "matthew.dp.96@gmail.com";
    SWEP.Purpose = "Hurls explosive rockets.";
    SWEP.Instructions = "Click to send a rocket flying";
    SWEP.Category = "Prop Launchers"
    SWEP.Spawnable = true;
    SWEP.AdminSpawnable = true;
    SWEP.ViewModel = "models/weapons/v_pistol.mdl";
    SWEP.WorldModel = "models/weapons/w_pistol.mdl"; 
    SWEP.Primary.ClipSize = -1;
    SWEP.Primary.DefaultClip = -1;
    SWEP.Primary.Automatic = false;
    SWEP.Primary.Ammo = "none"
end


Any suggestions?

[editline]21st February 2011[/editline]

bump?

second bump?

DrawAmmo never worked, I’ll try to remember how to do it.

Thanks

Okay, make all of those values shared except for SWEP.PrintName and the two slot positions, and the two draw ones.

This is what my first bit looks like.


if (SERVER) then
    AddCSLuaFile ("shared.lua");
    SWEP.Weight = 5;
    SWEP.AutoSwitchTo = false;
    SWEP.AutoSwitchFrom = false;
 
end
 
if (CLIENT) then
    SWEP.PrintName = "Rocket Hurling Device";
    SWEP.Slot = 4;
    SWEP.SlotPos = 1;
    SWEP.DrawAmmo = false;
    SWEP.DrawCrosshair = true;
end

if (SHARED) then
    SWEP.Author = "Matt";
    SWEP.Contact = "matthew.dp.96@gmail.com";
    SWEP.Purpose = "Hurls explosive rockets.";
    SWEP.Instructions = "Click to send a rocket flying";
    SWEP.Category = "Prop Launchers"
    SWEP.Spawnable = true;
    SWEP.AdminSpawnable = true;
    SWEP.ViewModel = "models/weapons/v_pistol.mdl";
    SWEP.WorldModel = "models/weapons/w_pistol.mdl"; 
    SWEP.Primary.ClipSize = -1;
    SWEP.Primary.DefaultClip = -1;
    SWEP.Primary.Automatic = false;
    SWEP.Primary.Ammo = "none"
end


If so, that didn’t work. But if nothing can be done for it, I’m just glad I got my first SWEP out there haha.

I don’t think SHARED is a global variable…

[lua]
if (SERVER) then
// AddCSLuaFile (“shared.lua”); // dumbass this goes in init.lua
SWEP.Weight = 5;
SWEP.AutoSwitchTo = false;
SWEP.AutoSwitchFrom = false;
//wtf is this space doing here, makes this look fugly
end

if (CLIENT) then
SWEP.PrintName = “The Facepalmer”;
SWEP.Slot = 4;
SWEP.SlotPos = 1;
SWEP.DrawAmmo = false; // This shit goes in SWEP:HUDShouldDraw() you dumbass
SWEP.DrawCrosshair = true; // Same with this http://wiki.garrysmod.com/?title=SWEP.HUDShouldDraw
end

//if (SHARED) then // dumbass the file is already shared… thats why you test SERVER and CLIENT, delete this line
SWEP.Author = “Dumbass”;
SWEP.Contact = “dumbass@gmail.com”;
SWEP.Purpose = “I’m a dumbass who thinks making a rocket shooting swep is awesome.”;
SWEP.Instructions = “Get Andriko banned for flaming with your nooby skills.”;
SWEP.Category = “1 minute sweps” //why would you put semi colons all over your code and not put one here, if you want to make your code look horrible, be consistent
SWEP.Spawnable = true;
SWEP.AdminSpawnable = true;
SWEP.ViewModel = “models/weapons/v_pistol.mdl”;
SWEP.WorldModel = “models/weapons/w_pistol.mdl”;
SWEP.Primary.ClipSize = -1;
SWEP.Primary.DefaultClip = -1;
SWEP.Primary.Automatic = false;
SWEP.Primary.Ammo = “none” // again with the semi colon shit, wtf is this a treasure hunt?
//end // and this
[/lua]

use lua tags dumbass, thats [lua] [/lua ] without the space at the end

Do I still get banned if I helped?

EDIT: Why rate me dumb…

Is there a page that lists all the available tags? I haven’t seen one out in the open easy to find, so if it exists, please share it or maybe just nicely ask to use lua tags because they’re easier to read? Not everyone magically knows everything to start with.

Edit:
I rated you dumb because your code example doesn’t help much more than belittle the person for asking a question. I have searched for the tag list before but could not find it because it’s called BB Code not tags, people will get told one at a time “BLARG!!! YARR!! use [this tag] damnit!” instead of a helpful link like below by gotskilz4u that shows the available tags… It just irks me when someone displays that, “WOW You’re so dumb!” attitude.

How did he magically know


 [/code ].
There might be on gmod wiki

http://www.facepunch.com/misc.php?do=bbcode

Thanks I was looking for that.

IIRC, you have to set the SWEP.Secondary.ClipSize to -1 as well as the ammotype to “none”

I think that’s only for the default weapon_base though…

@Andriko: Thanks? Thanks.