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!

Help with adding items to the player inventory.

Discussion in 'Discussion' started by Alko, Jan 9, 2013.

  1. Alko

    Alko Guest

    I didn't understand the function of giving some item to the player.
    In OA, there was command like playergiveitem("backpack","2"), so the player gets 2 backpacks.

    In CW, there is some command like Clockwork.item:CreateInstance(uniqueID, itemID, data).

    How can I control the number of the items that the server gives to the player?
     
  2. Warjekk

    Warjekk Games Development Student

    Code:
    for i = 1, AMOUNT_HERE do
    	Clockwork.inventory:AddInstance(
    		inventory, Clockwork.item:CreateInstance("item_id")
    	);
    end;
     
  3. alexgrist

    alexgrist Guest

    player:GiveItem still exists.
     
  4. Warjekk

    Warjekk Games Development Student

    Just noticed it in the "chargiveitem" command - thanks for clarifying.
     

Previous Readers (Total: 0)