A
          / \      _             Play Now                         Nemesis on fb
          | |     | |  _______   _        _   _______    _______   _    _______
          | |\    | | |   ____| |  \    /  | |   ____|  /   ____| | |  /   ____|
 /-------/-------------------------------------------------------------------,
O= Home <=XX|  About  News  Pics  Adventurers  Wizards  Download  Connect     >
 \-------\-------------------------------------------------------------------'
          | |   \   | |  |____  | |      | | |  |____   ___ \  \  | |  ___ \  \
          | |     \_| |_______| |_|      |_| |_______| |_______/  |_| |_______/
          \ /
           V  

Documentation Area

Document Path: /doc/living/add_money


Name: add_money - give money to a living

Syntax:
	#include <currency.h>
	add_money(int amount, int currency)
	add_money(int *amount, int currency)

Description:
	The add_money adds money to a living's purse. The living is not
	notified about this.

	In the old money system, the second argument is left away and amount
	is added to the number of gold coins of the player.
	
	The the new currency system are the following possibilities:
	If the amount argument is an integer the amount of money is added to
	the least valuable currency unit of the currency given. If the amount
	argument is an array with three elements, such as ({ x, y, z }), all
	elements of this array are added to the coresponding part of the money
	array in the living.

	Valid values for currency are listed in /include/currency.h.

	Note: If the living is a normal player, this will be logged.
	
Return value: none

Examples:
	Old system:
		this_player()->add_money(10);
		would add 10 gold coins to the player

	New system:
		this_player()->add_money( ({ 0, 5, 4 }) );
		would add 5 silver coins and 4 copper coins to the player

		this_player()->add_money(10, VIKING);
		would add 10 coins of the lowest currency unit of the viking
		currency to the player.
		
See also:


This page was generated in LPC

Imprint / Impressum