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!

HL2RP How do I add 'starter' items?

Discussion in 'Development' started by Glungus, Sep 30, 2017.

  1. I deleted the suitcase item, and I want to replace it with my own suitcase, how do I get around having it so when you make a citizen character you spawn with my new suitcase item?
     
  2. Gamer

    Gamer Clockwork Customer

    schema/sv_hooks.lua

    Code:
    -- Called when a player's default inventory is needed.
    function Schema:GetPlayerDefaultInventory(player, character, inventory)
       if (character.faction == FACTION_ADMIN) then
         Clockwork.inventory:AddInstance(
           inventory, Clockwork.item:CreateInstance("handheld_radio")
         );
       elseif (character.faction == FACTION_MPF) then
         Clockwork.inventory:AddInstance(
           inventory, Clockwork.item:CreateInstance("handheld_radio")
         );
       elseif (character.faction == FACTION_OTA) then
         Clockwork.inventory:AddInstance(
           inventory, Clockwork.item:CreateInstance("handheld_radio")
         );
       else
         Clockwork.inventory:AddInstance(
           inventory, Clockwork.item:CreateInstance("suitcase")
         );
       end;
    end;
    
    Change the "Clockwork.item:CreateInstance("suitcase")" for needed item uniqueID.
     
  3. redcatjack

    redcatjack Moderator and Map Developer Staff Member Moderator

    Just a reminder, when doing this, don't edit the schema directly. You should always do it in a plugin.
     
    • Agree Agree x 1

Previous Readers (Total: 0)