Is giftable: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle mNo edit summary |
imported>Bale gift.item proxy record |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 16: | Line 15: | ||
}}| | }}| | ||
function_description=This function checks to see if the item {{pspan|check_me}} can be sent as a gift, returning true if it can and false otherwise.| | function_description=This function checks to see if the item {{pspan|check_me}} can be sent as a gift, returning true if it can and false otherwise. Note that this will return true for all items that are not untradeable, not merely gift items. If you want to specifically know if an item is a gift item, then check the gift.item proxy record.| | ||
code1={{CodeSample| | |||
title=Code Sample| | |||
description=Differentiate between Gift item and giftable item.| | |||
code= | |||
<syntaxhighlight> | |||
void gift_kind( item check ) { | |||
if( check.gift == true ) | |||
print( check + " is a gift item." ); | |||
else if( is_giftable(check) ) | |||
print( check + " can be sent to another player." ); | |||
else | |||
print( check + " cannot be kMailed or traded to another player." ); | |||
} | |||
</syntaxhighlight>}}| | |||
see_also={{SeeAlso|is_displayable|is_tradeable}}| | see_also={{SeeAlso|is_displayable|is_tradeable}}| | ||
}} | }} | ||
[[Category:Item Management]] |
Latest revision as of 10:40, 10 November 2014
Function Syntax
boolean is_giftable(item check_me )
- check_me is an item to test
This function checks to see if the item check_me can be sent as a gift, returning true if it can and false otherwise. Note that this will return true for all items that are not untradeable, not merely gift items. If you want to specifically know if an item is a gift item, then check the gift.item proxy record.
Code Sample
Differentiate between Gift item and giftable item.
void gift_kind( item check ) {
if( check.gift == true )
print( check + " is a gift item." );
else if( is_giftable(check) )
print( check + " can be sent to another player." );
else
print( check + " cannot be kMailed or traded to another player." );
}