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!

Weapon Classes

Discussion in 'Programming' started by Garrus, Jun 20, 2013.

  1. Garrus

    Garrus I like dragons, yargh.

    Okay, I'm a bit new to lua code, trying to figure this out myself, anyways, can someone explain whats wrong with this code I am editing, It's two weapons from the M9K pack, and I can equip them both at the same time.
    [​IMG]
    The weapon is a "Dragunov SVD" and a "AK-47" from the M9K pack, this is what I have so far. In simplified terms, is it possible to force them onto secondary weapons so you can't equip them both at the same time. Asking because I have the same problem with a few other ones..

    Dragunov SVD
    Code:
    --[[
            ? 2013 CloudSixteen.com do not share, re-distribute or modify
            without permission of its author ([email protected]).
    --]]
     
    local ITEM = Clockwork.item:New("weapon_base");
            ITEM.name = "Dragunov SVD";
            ITEM.cost = 2100;
            ITEM.model = "models/weapons/w_svd_dragunov.mdl";
            ITEM.weight = 2.6;
    	ITEM.access = "F";
            ITEM.business = true;
            ITEM.uniqueID = "m9k_dragunov";
            ITEM.description = "A sniper rifle manafactured in Russia which consists of metal and wood.";
            ITEM.isAttachment = true;
            ITEM.hasFlashlight = true;
    	ITEM.loweredOrigin = Vector(3, 0, -4);
    	ITEM.loweredAngles = Angle(0, 45, 0);
            ITEM.attachmentBone = "ValveBiped.Bip01_Spine";
            ITEM.attachmentOffsetAngles = Angle(0, 0, 0);
            ITEM.attachmentOffsetVector = Vector(-2, 5, 4);
    ITEM:Register();

    AK-47
    Code:
    --[[
    	? 2013 CloudSixteen.com do not share, re-distribute or modify
    	without permission of its author ([email protected]).
    --]]
    
    local ITEM = Clockwork.item:New("weapon_base");
    	ITEM.name = "AK-47";
    	ITEM.cost = 1600;
    	ITEM.model = "models/weapons/w_ak47_m9k.mdl";
    	ITEM.weight = 2;
    	ITEM.access = "F";
    	ITEM.classes = {CLASS_EMP, CLASS_EOW};
    	ITEM.business = true;
    	ITEM.uniqueID = "m9k_ak47";
    	ITEM.description = "An assault rifle with a wooden barrel.";
    	ITEM.isAttachment = true;
    	ITEM.hasFlashlight = true;
    	ITEM.loweredOrigin = Vector(3, 0, -4);
    	ITEM.loweredAngles = Angle(0, 45, 0);
    	ITEM.attachmentBone = "ValveBiped.Bip01_Spine";
    	ITEM.attachmentOffsetAngles = Angle(0, 0, 0);
    	ITEM.attachmentOffsetVector = Vector(-2, 5, 4);
    ITEM:Register();
     
  2. Datzy

    Datzy Guest

    they're being equipped as primaries

    also

    [​IMG]

    [​IMG]
     
  3. The weight determines whether or not it's a primary or secondary, if I recall correctly.
     
  4. Garrus

    Garrus I like dragons, yargh.

    Jesus, I never would of guessed that, thanks, will work on the rest of them, properly positioned hopefully, thanks.
     
  5. sants1

    sants1 I'm an asshole. That's all.

    Do you mind posting it? I can put it on my M9K thread.
     

Previous Readers (Total: 0)