(Defined and added simple examples to SInventory .AddToHotbar .RemoveFromHotbar) |
(Defined and added simple example to SInventory.Authorized) |
||
Line 2: | Line 2: | ||
==Members== | ==Members== | ||
− | {{ScriptFunction|void|Authorize|();| | + | {{ScriptFunction|void|Authorize|();|Requests access to inventory functions, must be called prior to attempting to access inventory. As soon as the player has accepted the request, the Authorized attribute will be 'true'.|5= |
<pre> Space.Inventory.Authorize()</pre>}} | <pre> Space.Inventory.Authorize()</pre>}} | ||
Line 19: | Line 19: | ||
{{ScriptFunction|SInventoryItem|Items[]|{ get; }|Returns the array of the users current inventory items|5= | {{ScriptFunction|SInventoryItem|Items[]|{ get; }|Returns the array of the users current inventory items|5= | ||
<pre>invItems = Space.Inventory.Items</pre>}} | <pre>invItems = Space.Inventory.Items</pre>}} | ||
+ | {{ScriptFunction|bool|Authorized|{ get; }|Returns true if player has accepted access authorization request to his inventory|5= | ||
+ | <pre>isAuthorized = Space.Inventory.Authorized</pre>}} | ||
{{Scripting Navbox}} | {{Scripting Navbox}} |
The SInventory class allows you to access a users inventory
Requests access to inventory functions, must be called prior to attempting to access inventory. As soon as the player has accepted the request, the Authorized attribute will be 'true'.
Space.Inventory.Authorize()
Forces a check for external changes to the users inventory, can only be called once every 60 seconds
Space.Inventory.RequestRefresh()
Adds the first found instance of itemID to the players hotbar entry at slot 'index'.
Space.Inventory.AddToHotbar(2, 23423523)
Remove item at slot index from Hotbar
Space.Inventory.RemoveFromHotbar(2)
Returns the array of the users current inventory items
invItems = Space.Inventory.Items
Returns true if player has accepted access authorization request to his inventory
isAuthorized = Space.Inventory.Authorized
|