1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Ammo for custom guns

Discussion in 'Discussion' started by Alevaric, Feb 2, 2013.

  1. After adding custom guns to our sever we then planned on adding some ammo to suit these weapons, or in turn make the weapon able to use that ammo. Unfortunately I don't really know anything about how I would go around doing this.

    If someone could help or even tell me how I would go around making some ammo for these custom guns, or tell me how I can add a weapon to use the existing ammo I will be very grateful.
     
  2. Teegee

    Teegee PM me for help, I'm always willing to lend a

    I assume the custom weapons are from a swep, locate to the swep and look for:
    schema/entities/weapons, usually.

    SWEP.Primary.Ammo

    There you will be able to determine what the ammunition type is for the weapon for example,

    SWEP.Primary.Ammo = "buckshot";

    Then you want to go to your items directory in your schema and edit/create an ammunition item like this for example,

    local ITEM = Clockwork.item:New("ammo_base"); This is the base used for ammunition.
    ITEM.base = "ammo_base";
    ITEM.name = "Buckshot Rounds";
    ITEM.model = "models/items/boxbuckshot.mdl";
    ITEM.weight = 0.5;
    ITEM.uniqueID = "ammo_buckshot";
    ITEM.ammoClass = "buckshot"; This calls the ammo class for the item.
    ITEM.business = true;
    ITEM.ammoAmount = 12;
    ITEM.description = "A small red box filled with Buckshot on the side.";

    ITEM:Register();

    ITEM.uniqueID = "ammo_buckshot"; - Just a unique Identification for the item, just go from what item you are using in this case ammo_buckshot. If it's a weapon or another form of ammunition then use ammo/weapon then _Weapon or Ammo (lowercase). Up to you what you name it.

    If you look in other ammunition items that you have in your schema you will see there are other types of ammunition that can be used:

    buckshot - Shotguns.
    357 - Magnums and the such.
    pistol - Self explanatory.
    rpg_round - Rocket Launchers.
    smg1 - Machine-guns and such.
    ar2 - Sniper ammunition/Pulse Rifle and such.
    xbowbolt - Usually used for Crossbows.


    But some of these are used in different ways, it all depends what the sweps ammunition class is, which you can find out from what I said above. Hopefully I explained this clear enough and correctly.
     
  3. In addition to the above post, you can use game.AddAmmoType to add custom ammo types. Create an ent for your ammo type and you're good to go. That's what I'm doing for my custom pack.
     

Previous Readers (Total: 0)