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!

Default Union Card for CWU

Discussion in 'Requests' started by ag55, Oct 27, 2018.

  1. ag55

    ag55 NOPE.AVI Clockwork Customer

    So I've retrieved the union lock, and I'd like to give the union card to the CWU class by default. I'm unsure what hooks to use, as I'm quite new. If anyone's got any helpful links or resources that's would be great. Any suggestions or pointers in the right direction would help massively, thank you.
     
  2. _HappyGoLucky

    _HappyGoLucky Clockwork Customer

    so for some reason kuro (or someone please dont berate me) added a method to give default inventory in the faction file

    in your CWU faction file, do this
    Code:
    FACTION.startingInv = {
        ["union_card"] = 1
    }
    i've never actually used this but im psure thats how you use it

    heres the function for it
    Code:
    -- Called when a player's default inventory is needed.
    function Clockwork:GetPlayerDefaultInventory(player, character, inventory)
        local startingInv = cwFaction:FindByID(character.faction).startingInv;
     
        if (istable(startingInv)) then
            for k, v in pairs(startingInv) do
                cwInventory:AddInstance(
                    inventory, cwItem:CreateInstance(k), v
                );
            end;
        end;
    end;
     

Previous Readers (Total: 0)