scripting:reference:system_functions:playerinventoryandwealthfunctions
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting:reference:system_functions:playerinventoryandwealthfunctions [2020/01/29 12:09] – mit | scripting:reference:system_functions:playerinventoryandwealthfunctions [2025/05/28 18:58] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ==== sysPlayerInventory ==== | ||
| + | ^ Format | sysPlayerInventory ( Item )| | ||
| + | ^ Description | Returns the number of an item the current player currently possesses | | ||
| + | ^ Returns | Amount carried | | ||
| + | ^ Notes | **Item** parameter can be the name or number of the item | | ||
| + | // | ||
| + | < | ||
| + | { | ||
| + | $hasKeys = sysPlayerInventory( " | ||
| + | if ( $hasKeys == 0 ) | ||
| + | { | ||
| + | *msg %PLAYER% You cannot access this building without keys | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||
| ==== sysAddToInventory ==== | ==== sysAddToInventory ==== | ||
| - | ^ Format | sysAddToInventory ( [Item], [Amount] )| | + | ^ Format | sysAddToInventory ( Item, Amount )| |
| ^ Description | Attempts to add an item to the current player' | ^ Description | Attempts to add an item to the current player' | ||
| - | ^ 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' | + | ^ 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' |
| // | // | ||
| < | < | ||
| Line 21: | Line 38: | ||
| </ | </ | ||
| ==== sysGetInventoryItemIndex ==== | ==== sysGetInventoryItemIndex ==== | ||
| - | ^ Format | sysGetInventoryItemIndex ( [index] )| | + | ^ Format | sysGetInventoryItemIndex ( index )| |
| ^ Description | Returns the item in the current player' | ^ Description | Returns the item in the current player' | ||
| - | ^ 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. |
| // | // | ||
| < | < | ||
| Line 43: | Line 59: | ||
| ==== sysAddWealth ==== | ==== sysAddWealth ==== | ||
| - | TBD: | + | ^ Format | sysAddWealth ( Amount, |
| + | ^ 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: | ||
| + | ^ 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** | | ||
| + | // | ||
| + | < | ||
| + | { | ||
| + | *grantitem %PLAYER% -1 WelfareCheque | ||
| + | sysAddWealth( 1000, " | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| ==== sysRemoveWealth ==== | ==== sysRemoveWealth ==== | ||
| TBD: sysRemoveWealth( Amount, ACCOUNT_SOURCE ) | TBD: sysRemoveWealth( Amount, ACCOUNT_SOURCE ) | ||
| + | |||
| + | ===== Related System Values ===== | ||
| + | Some information regarding the player wealth inventory is provided through [[scripting: | ||
| + | \\ | ||
| + | \\ | ||
| + | **$gPlayerCash**, | ||
| + | |||
scripting/reference/system_functions/playerinventoryandwealthfunctions.1580299748.txt.gz · Last modified: (external edit)
