TakePlayerMoney
From Multi Theft Auto: Wiki
This function subtracts money from a player's current money amount.
Note: Using this function client side (not recommended) will not change a players money server side. |
Syntax
Click to collapse [-]
Serverbool takePlayerMoney ( player thePlayer, int amount )
OOP Syntax Help! I don't understand this!
- Method: player:takeMoney(...)
- Variable: .money
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.
Click to collapse [-]
Clientbool takePlayerMoney ( int amount )
OOP Syntax Help! I don't understand this!
- Method: Player.takeMoney(...)
Required Arguments
- 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
Click to collapse [-]
ServerThis 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
- forcePlayerMap
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerBlurLevel
- getPlayerCount
- getPlayerFromName
- getPlayerIdleTime
- getPlayerIP
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
FROM VERSION 1.5.7 r19626 ONWARDS
- getPlayerSerial
- getPlayerTeam
- getPlayerVersion
- getPlayerWantedLevel
- getRandomPlayer
- givePlayerMoney
- isPlayerMapForced
- isPlayerMuted
- isPlayerNametagShowing
- isVoiceEnabled
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerBlurLevel
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerMuted
- setPlayerName
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
FROM VERSION 1.5.7 r19626 ONWARDS