GivePlayerMoney: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
Adds money to the player's current money amount.
This function adds money to a [[player]]'s current money amount.


==Syntax==  
==Syntax==  

Revision as of 14:57, 25 April 2007

This function adds money to a player's current money amount.

Syntax

bool givePlayerMoney ( player thePlayer, int amount )

Required Arguments

  • thePlayer: the player to whom you are giving the money.
  • amount: an integer number specifying the amount of money to give to the player.

Returns

Returns true if the money was added, or false if invalid parameters were passed.

Example

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

addCommandHandler ( "givecash", "giveCash" ) --add a handler function for the command "givecash"
function giveCash ( thePlayer, command, amount ) --when the givecash command is called
	givePlayerMoney ( thePlayer, amount ) --give the player money according to the amount
end

See Also