1234567891011121314151617181920212223242526272829303132333435363738394041 |
- # $single_stock_item
- !! generic function to be used to stock single purchase items in stores
- !! see [shop], specifically the household appliances section for an example of use
- !! ARGS 0 is the value identifying when the item is owned
- !! it is assumed that anything >= the value is acceptable, this allows for upgrades like regular tv to plasma
- !! ARGS 1 is the item description
- !! ARGS 2 is the price
- !! ARGS 3 is the variable name for the item
- !! ARGS 4 is the location to go back to
- !! ARGS 5 is $metka
- !! ARGS 6 > 0 to force-disable buy link
- !! ARGS 7 is replacement text for 6
- !! ARGS 8 is custom buy link when ARGS 6 > 0
- !$location = $ARGS[4]
- !! This will check to see if the item is already owned
- dynamic 'in_inventory = <<$ARGS[3]>>'
- $in_inventory = iif(in_inventory > 0, '<<in_inventory>>', 'none')
- $RESULT = '<tr>' + _
- '<td align="center"><<FUNC(''$stock_item_info'', $ARGS[3])>></td>' + _
- '<td align="center"><<$ARGS[1]>></td>'
- if ARGS[6] > 0:
- $RESULT += '<td align=left>'+$ARGS[7]+'</td><td align=left>'+$ARGS[8]+'</td>'
- elseif ARGS[0] > in_inventory:
- $RESULT += '<td align="left">(you have <<$in_inventory>>)</td>'
- if money >= ARGS[2]:
- $RESULT += '<td align="left"><a href="exec: gs ''$buy_single_item'', <<ARGS[0]>>, ''<<$ARGS[1]>>'', <<ARGS[2]>>, ''<<$ARGS[3]>>'', ''<<$ARGS[4]>>''">buy</a>'
- else
- $RESULT += '<td></td>'
- end
- else
- $RESULT += '<td colspan=2 align=center>You already own this</td>'
- end
- $RESULT += '</td><td align="left">for <<ARGS[2]>> <b>₽</b></td></tr>'
- --- $single_stock_item ---------------------------------
|