TakePlayerMoney: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function | This function subtracts money from a [[player]]'s current money amount. | ||
==Syntax== | ==Syntax== | ||
Line 17: | Line 17: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function takeCash ( thePlayer, command, amount ) -- when the takecash command is called | function takeCash ( thePlayer, command, amount ) -- when the takecash command is called | ||
takePlayerMoney ( thePlayer, amount ) | takePlayerMoney ( thePlayer, tonumber(amount) ) -- take the amount of money from the player | ||
end | end | ||
addCommandHandler ( "takecash", takeCash ) -- add a handler function for the command "takecash" | addCommandHandler ( "takecash", takeCash ) -- add a handler function for the command "takecash" |
Revision as of 18:41, 21 August 2007
This function subtracts money from a player's current money amount.
Syntax
bool takePlayerMoney ( player thePlayer, int amount )
Required Arguments
- thePlayer: the player you are taking the money from.
- amount: an integer number specifying the amount of money to take from the player.
Returns
Returns true if the money was taken, or false if invalid parameters were passed.
Example
This example takes money from a player when he types "takecash number" in the console.
function takeCash ( thePlayer, command, amount ) -- when the takecash command is called takePlayerMoney ( thePlayer, tonumber(amount) ) -- take the amount of money from the player end addCommandHandler ( "takecash", takeCash ) -- add a handler function for the command "takecash"
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState