_buy_item.qsrc 581 B

12345678910111213141516171819202122
  1. # $buy_item
  2. !! call this to actually buy an item from a store
  3. !! ARGS 0 is the value to set the variable to
  4. !! ARGS 1 is the item description
  5. !! ARGS 2 is the price
  6. !! ARGS 3 is the variable name for the item
  7. !! ARGS 4 is the location to go back to
  8. !! ARGS 5 is $metka
  9. count = ARGS[0]
  10. $item = $ARGS[1]
  11. price = ARGS[2]
  12. $variable_name = $ARGS[3]
  13. dynamic "set <<$variable_name>> += <<count>>"
  14. set money -= price
  15. $message = '<center><font color="green">You bought <<count>> <b><<$item>></b>.</font></center>'
  16. gt $ARGS[4], $ARGS[5]
  17. --- $buy_item ---------------------------------