Is tradeable: Difference between revisions
Jump to navigation
Jump to search
Created page with ''''boolean is_tradeable( item )''' Returns true if the item you requested is tradeable, and false otherwise.' |
imported>Bale slightly better-er. |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | |||
#vardefine:name|is_tradeable}}{{ | |||
#vardefine:return_type|boolean}}{{ | |||
FunctionPage| | |||
name={{#var:name}}| | |||
function1={{Function| | |||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}}| | |||
parameter1={{Param|item|check_me}}| | |||
p1desc={{Pspan|check_me}} is an item to test| | |||
}}| | |||
function_description=This function checks to see if the item {{pspan|check_me}} can be traded via the Mall, returning true if it can and false otherwise.| | |||
code1={{CodeSample| | |||
title=Code Samples| | |||
description=The following function dumps your entire inventory into your mall store.| | |||
code= | |||
<syntaxhighlight> | |||
void inv_dump() { | |||
if(have_shop()) { | |||
foreach i in get_inventory() | |||
if(is_tradeable(i)) put_shop(0, 0, i); | |||
} | |||
} | |||
</syntaxhighlight> | |||
}}| | |||
see_also={{SeeAlso|is_displayable|is_giftable}}| | |||
}} | |||
[[Category:Item Management]] |
Latest revision as of 21:55, 20 August 2010
Function Syntax
boolean is_tradeable(item check_me )
- check_me is an item to test
This function checks to see if the item check_me can be traded via the Mall, returning true if it can and false otherwise.
Code Samples
The following function dumps your entire inventory into your mall store.
void inv_dump() {
if(have_shop()) {
foreach i in get_inventory()
if(is_tradeable(i)) put_shop(0, 0, i);
}
}