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 a new Uniform item

Discussion in 'Programming' started by Bloodprime, Mar 11, 2013.

  1. Bloodprime

    Bloodprime WARPAC Lead

    I'm trying to make a Superior Resistance Uniform, which gives every citizen who wears it the same 'Tactical Rebel' model. Here is what I have at the moment:

    Code:
    --[[
    	© 2012 CloudSixteen.com do not share, re-distribute or modify
    	without permission of its author ([email protected]).
    --]]
    
    local ITEM = Clockwork.item:New("clothes_base");
    ITEM.name = "Superior Resistance Uniform";
    ITEM.group = "group03";
    ITEM.weight = 3;
    ITEM.access = "m";
    ITEM.business = false;
    ITEM.protection = 0.1;
    ITEM.description = "A resistance uniform with a yellow symbol on the sleeve.";
    
    -- Called when a replacement is needed for a player.
    function ITEM:GetReplacement(player)
    	if (string.lower( player:GetModel() ) == "models/humans/group01/*.mdl") then
    		return "models/Tactical_Rebel.mdl";
    	end;
    end;
    
    ITEM:Register();
    Currently, it still assigns citizens to the group03 resistance uniform model. How can I get it so that anyone who wears it is set to: models/Tactical_Rebel.mdl
     
  2. Change
    Code:
    ITEM.group = "group03";
     
  3. Bloodprime

    Bloodprime WARPAC Lead

    I did this intentionally as I thought that

    Code:
    -- Called when a replacement is needed for a player.
    function ITEM:GetReplacement(player)
    	if (string.lower( player:GetModel() ) == "models/humans/group01/*.mdl") then
    		return "models/Tactical_Rebel.mdl";
    	end;
    would fix it.

    What should I change?
     
  4. Bloodprime

    Bloodprime WARPAC Lead

    Worked, thanks!
     

Previous Readers (Total: 0)