# Buy

Objects
Creation
5.1 OC
object
id buy_object Type of object to be bought.
int for_player Owner (player number) of the new object.
int pay_player Number of the player who pays for the object.
object to_base Target object in which the new object is placed. This parameter can be left out if the calling object is the base.
bool show_errors If specified and not `false`, failure messages such as "Buying not possible" are displayed, e.g. if there is not enough money.
Buys an object for for_plr, deducting the wealth of pay_player. The function will fail if the paying player does not have enough money or the object is currently not available in the home base material.
Buy(Rock, 0, 0, FindBase(0), true);
Buys a rock at the base of the first player.
Sell
GetWealth
GetBase
FindBase
Sven2
2001-11