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!

Adding New Guns

Discussion in 'Discussion' started by Bescharlie, Jun 4, 2013.

  1. Bescharlie

    Bescharlie Im on the right, sucha pretty little boy ;')

    I wanted to add several new guns to my Phase four, probably under a new section of teh crafting menu :)

    How is this done?

    - i have the weapons i want to add, and they are installed on the server.

    Charlie
     
  2. Daze

    Daze Retired Support

    Hello Bescharlie!

    If you mean you'd like to make the SWEPS usable guns in the server you'd have to go into your schema's items folder and make a new .lua file titled: "sh_weaponname.lua. Within the file this is what is necessary:
    Code:
    local ITEM = Clockwork.item:New("weapon_base");
    	ITEM.cost = 525;
    	ITEM.name = "G36C";
    	ITEM.model = "models/weapons/w_hk_g36c.mdl";
    	ITEM.batch = 1;
    	ITEM.weight = 3;
    	ITEM.access = "T";
    	ITEM.business = true;
    	ITEM.weaponClass = "m9k_g36";
    	ITEM.description = "A very rare rifle designed not long before the world ended.";
    	ITEM.isAttachment = true;
    	ITEM.attachmentBone = "ValveBiped.Bip01_Spine";
    	ITEM.weaponCopiesItem = true;
    	ITEM.attachmentOffsetAngles = Angle(20, 70, 15);
    	ITEM.attachmentOffsetVector = Vector(10, 0, -8);
    Clockwork.item:Register(ITEM);
    NOTE: This code above is used from a G36c coded into my Clockwork server. You can use it as a template for adding in your own.
     
  3. Bescharlie

    Bescharlie Im on the right, sucha pretty little boy ;')

    Extremely clear now, Top support! Thank you!

    Actually one thing, how do i find an
    Item.Weaponclass ?


    (edit your last post, next time)
     
  4. alexanderk

    alexanderk a Legend

    That's usually the name of the folder the weapon is in
     
  5. 1. Create a folder (schema/entities/entities/weapons/cw_ak47 for example)

    2. Inside of that folder, put the shared.lua file of the gun in there.

    3. Create an actual Clockwork item, and set ITEM.uniqueID to (the thing you named the folder).

    Code:
    ITEM.uniqueID = "cw_ak47";
     
  6. Kezter

    Kezter Certified Old Fag

    This may possibly help him if he uses the M9K sweps but I've noticed if pepole run out of ammo the weapon completely vanishes and if they use /charfallover it gives them ammo. Anyone know how to stop this?
     
  7. SkillerPenguin

    SkillerPenguin Owner of MineBull Gaming Community

    m9kremoveweapons 0 or something along those lines in console.
     
  8. SkillerPenguin

    SkillerPenguin Owner of MineBull Gaming Community

    "m9kweaponstrip 0" or something along those lines in console.
     
  9. Kezter

    Kezter Certified Old Fag

    I figured it out ages ago.
     
  10. SkillerPenguin

    SkillerPenguin Owner of MineBull Gaming Community

    Well then.
     
  11. Vox

    Vox Voxy voxy.

    I've tried making some M9K weapons to work (I have a plugin for that, but it only contains few weapons).
    Code:
    local ITEM = Clockwork.item:New("weapon_base");
    	ITEM.name = "Barrett M82";
    	ITEM.cost = 2600;
    	ITEM.model = "models/weapons/w_barret_m82.mdl";
    	ITEM.weight = 5;
    	ITEM.business = false;
    	ITEM.uniqueID = "m9k_barrett_m82";
    	ITEM.description = "A recoil-operated, semi-automatic anti-materiel rifle.";
    	ITEM.isAttachment = false;
    	ITEM.hasFlashlight = false;
    	ITEM.attachmentBone = "ValveBiped.Bip01_Spine";
    	ITEM.attachmentOffsetAngles = Angle(0, 0, 0);
    	ITEM.attachmentOffsetVector = Vector(-3.96, 4.95, -2.97);
    ITEM:Register();
    It shows ans an item, goes to inventory and when dropped it is there, can be dragged and taken, but not equipped. It just makes a random sound and does not equip. Anyone knows why?
     

Previous Readers (Total: 0)