TakePlayerMoney: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Updated to command handlers from onConsole) |
||
Line 10: | Line 10: | ||
==Example== | ==Example== | ||
This example takes a player money when he types "takecash" in console | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">addCommandHandler ( "takecash", "takeCash" ) --add the command "takecash" | ||
function | function takeCash ( player, command, amount ) --when the takecash command is called | ||
takePlayerMoney ( player, amount ) --take the player's money according to the amount | |||
end</syntaxhighlight> | end</syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Player functions}} | {{Player functions}} |
Revision as of 23:53, 17 November 2006
Subtracts money from the player's current money amount.
Syntax
takePlayerMoney ( 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 takes a player money when he types "takecash" in console
addCommandHandler ( "takecash", "takeCash" ) --add the command "takecash" function takeCash ( player, command, amount ) --when the takecash command is called takePlayerMoney ( player, amount ) --take the player's money according to the amount end
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