GivePlayerMoney

From Multi Theft Auto: Wiki
Revision as of 23:54, 17 November 2006 by Talidan (talk | contribs) (example - onConsole -> command handlers)
Jump to navigation Jump to search

Adds money to the player's current money amount.

Syntax

givePlayerMoney ( player, money )

Required Arguments

  • Player: Tells the function to give money to a player
  • Money: A whole integer specifying the amount of money to give to the player

Example

This example gives a player money when he types "givecash" in console

addCommandHandler ( "givecash", "giveCash" ) --add the command "takecash"
function giveCash ( player, command, amount ) --when the takecash command is called
	givePlayerMoney ( player, amount ) --take the player's money according to the amount
end

See Also