User Tools

Site Tools


scripting:reference:system_functions:playerinventoryandwealthfunctions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripting:reference:system_functions:playerinventoryandwealthfunctions [2020/01/30 03:34] mitscripting:reference:system_functions:playerinventoryandwealthfunctions [2020/02/07 03:17] (current) mit
Line 1: Line 1:
 ==== sysPlayerInventory ==== ==== sysPlayerInventory ====
-^ Format | sysPlayerInventory ( [Item)| +^ Format | sysPlayerInventory ( Item )| 
-^ Description | Returns the number of an item the current player currently posesses | +^ Description | Returns the number of an item the current player currently possesses |
-^ Parameters | **[Item]** - Name or number of the item |+
 ^ Returns | Amount carried | ^ Returns | Amount carried |
 +^ Notes | **Item** parameter can be the name or number of the item |
 //Example//: <note> //Example//: <note>
 <code>Event( "PreAccessBuilding", "10" ) <code>Event( "PreAccessBuilding", "10" )
Line 19: Line 19:
  
 ==== sysAddToInventory ==== ==== sysAddToInventory ====
-^ Format | sysAddToInventory ( [Item][Amount)|+^ Format | sysAddToInventory ( Item, Amount )|
 ^ Description | Attempts to add an item to the current player's inventory. | ^ Description | Attempts to add an item to the current player's inventory. |
-^ Parameters | **[Item]** - Name or number of the item | 
-^ | **[Amount]** - Amount of the item to be added | 
 ^ Returns | **[Amount added]** - The actual amount of the item that was added | ^ Returns | **[Amount added]** - The actual amount of the item that was added |
-^ Notes | This is an alternate method to calling ***grantitem [PlayerName] [Amount] [Item]** but the sys function does not message the player unlike *grantitem. Also, this function adheres to the player's capacity limit (*grantitem ignores it) - no items will be added if the player's inventory is already full. |+^ Notes | **Item** parameter can be the name or number of the item. This is an alternate method to calling ***grantitem [PlayerName] [Amount] [Item]** but the sys function does not message the player unlike *grantitem. Also, this function adheres to the player's capacity limit (*grantitem ignores it) - no items will be added if the player's inventory is already full. |
 //Example//: <note> //Example//: <note>
 <code>Event( "UseSkill", "Baker" ) <code>Event( "UseSkill", "Baker" )
Line 40: Line 38:
 </code></note> </code></note>
 ==== sysGetInventoryItemIndex ==== ==== sysGetInventoryItemIndex ====
-^ Format | sysGetInventoryItemIndex ( [index)|+^ Format | sysGetInventoryItemIndex ( index )|
 ^ Description | Returns the item in the current player's inventory. | ^ Description | Returns the item in the current player's inventory. |
-^ Parameters | **[index]** - Inventory slot number | 
 ^ Returns | **[ItemNum]** - The item number in the specified inventory slot (or 0 if the slot is empty) | ^ Returns | **[ItemNum]** - The item number in the specified inventory slot (or 0 if the slot is empty) |
-^ Notes | Players currently have up to 64 inventory slots. |+^ Notes | Parameter is the inventory slot number. Players currently have up to 64 inventory slots. |
 //Example//: <note> //Example//: <note>
 <code>Event( "Custom", "ListInventory" ) <code>Event( "Custom", "ListInventory" )
Line 62: Line 59:
  
 ==== sysAddWealth ====  ==== sysAddWealth ==== 
-^ Format | sysAddWealth ( [Amount (in denari)], [ACCOUNT_SOURCE] )|+^ Format | sysAddWealth ( Amount, [ACCOUNT_SOURCE] )|
 ^ Description | Gives money to the player. This is an alternative to the ***grantcash [PLAYER] [AMOUNT]** command; money given to the player via grantcash always appears on their in-game accounts as 'Gifts from God', where the sysAddWealth gives you the extra option of specifying the [[scripting:reference:system_functions:AccountSources|Account Source]] - if you're making a full economy world and it can be important for the players to have the accounts view available and this data can also be used to generate econ stats delivered to an external website. | ^ Description | Gives money to the player. This is an alternative to the ***grantcash [PLAYER] [AMOUNT]** command; money given to the player via grantcash always appears on their in-game accounts as 'Gifts from God', where the sysAddWealth gives you the extra option of specifying the [[scripting:reference:system_functions:AccountSources|Account Source]] - if you're making a full economy world and it can be important for the players to have the accounts view available and this data can also be used to generate econ stats delivered to an external website. |
-^ Parameters | **[Amount]** - cash to be given in denari | 
-^ | **[Account Source]** | 
 ^ Returns | Amount added. Usually the same as you requested but there are some settings that can limit the amount of cash the player can have, and these restrictions are applied here. | ^ Returns | Amount added. Usually the same as you requested but there are some settings that can limit the amount of cash the player can have, and these restrictions are applied here. |
 +^ Notes | **[Amount]** is cash to be given in **denari** |
 //Example//: <note> //Example//: <note>
 <code>Event( "UseItem", "WelfareCheque" ) <code>Event( "UseItem", "WelfareCheque" )
Line 79: Line 75:
 TBD:  sysRemoveWealth( Amount, ACCOUNT_SOURCE )  TBD:  sysRemoveWealth( Amount, ACCOUNT_SOURCE ) 
  
-===== Related System Vals ===== +===== Related System Values ===== 
-Much information regarding the player inventory is provided through [[scripting:reference:system_values|System Values]] - relevant ones are: +Some information regarding the player wealth inventory is provided through [[scripting:reference:system_values|System Values]] - relevant ones are: 
-**$gPlayerCash**, **gPlayerCashSheckles**, **gPlayerInventoryFree**, **gPlayerInventoryUsed**, +\\ 
 +\\ 
 +**$gPlayerCash**, **$gPlayerCashSheckles**, **$gPlayerInventoryFree**, **$gPlayerInventoryUsed**, 
  
  
  
  
scripting/reference/system_functions/playerinventoryandwealthfunctions.1580376885.txt.gz · Last modified: 2020/01/30 03:34 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki