takePlayerMoney | Multi Theft Auto: Wiki Skip to content

takePlayerMoney

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


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

takePlayerMoney ( )

Code Examples

server

This example takes money from a player when he types "takecashnumber" 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