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!

Weapons with custom models show up as errors.

Discussion in 'Discussion' started by Wallet, Jan 17, 2013.

  1. I tried to add a custom weapon with the 1911 model from some pack, and it's showing up as an error.

    It's mainly a test, so I just modified the pistols code by replacing the uniqueID, model directory, and name. I did this quick and dirty so I put the kernal.add* in the sh_1911.lua as well.

    Weapon's code:
    Code:
    Clockwork.kernel:AddDirectory("materials/models/weapons/1911/*.*");
    Clockwork.kernel:AddFile("models/weapons/j_pist_1911.mdl");
    
    local ITEM = Clockwork.item:New("weapon_base");
    	ITEM.name = "1911";
    	ITEM.cost = 100;
    	ITEM.model = "models/weapons/j_pist_1911.mdl";
    	ITEM.weight = 1;
    	ITEM.access = "V";
    	ITEM.classes = {CLASS_EMP, CLASS_EOW};
    	ITEM.uniqueID = "weapon_1911";
    	ITEM.business = true;
    	ITEM.description = "A test pistol PISSSSS.";
    	ITEM.isAttachment = true;
    	ITEM.loweredOrigin = Vector(3, 0, -4);
    	ITEM.loweredAngles = Angle(0, 45, 0);
    	ITEM.attachmentBone = "ValveBiped.Bip01_Pelvis";
    	ITEM.attachmentOffsetAngles = Angle(0, 0, 90);
    	ITEM.attachmentOffsetVector = Vector(0, 4, -8);
    ITEM:Register();
     
  2. Did you add it to your server's resources or to Clockwork's kernel?

    Go to sv_kernel to add it.
     
  3. I'll try that.

    Didn't work. I placed the Clockwork.kernel.add** functions in sv_kernel in clockwork/framework. The mdel is still an error and I can't equip the weapon.
     
  4. MKW9813

    MKW9813 The community REDCAT-Gaming has to put up with me.

    I am guessing you're using the Insurgency weapons judging by the world model. The 1911's SWEP is weapon_ins_sim_Colt1911
     
  5. I am yeah, but what does the SWEP has to do with it?

    When I drop the weapon, it isn't an error model, but I can't equip it.
     
  6. bender971

    bender971 condescending, self important teenage boy

  7. Tompkins

    Tompkins Developer for Laughing Skull Studios

    The code to the weapon itself is broken. It's not clockwork/cwhl2rp, it's the swep.
     
  8. Allahabar

    Allahabar Unity Is All

    No, the problem is not the swep.
    The problem is that you have the wrong uniqeID, that is why when you try to equipt it, nothing happens, because there is no swep with the name weapon_colt I take it.
    So replace the ID to weapon_ins_sim_Colt1911, since the weapon base uses the uniqeID to specify what weapon it should give you, so you cant just write something random, (As you can for normal items or whatnot)
     
  9. MKW9813

    MKW9813 The community REDCAT-Gaming has to put up with me.

    Your 1911 item should look like:

    [​IMG]
     
  10. Thank you.
     

Previous Readers (Total: 0)