GetPlayerMoney: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:
if gettok(message, 1, 32) == "!checkcash" then --when the player types !checkcash in the console
if gettok(message, 1, 32) == "!checkcash" then --when the player types !checkcash in the console
local playermoney = getPlayerMoney ( source ) --set playermoney varible to player's current cash
local playermoney = getPlayerMoney ( source ) --set playermoney varible to player's current cash
serverChat ( "Your cash: ".. playermoney ) --display their current cash in the chatbox
outputChatBox ( "Your cash: ".. playermoney ) --display their current cash in the chatbox
end
end
end</syntaxhighlight>
end</syntaxhighlight>

Revision as of 03:20, 20 May 2006

Returns the money level of a player

Syntax

getPlayerMoney ( player )

Required Arguments

  • Player: Tells the function to give money to a player

Example

addEventHandler ( "onPlayerConsole", root, "onConsole" )
function onConsole ( message )
	if gettok(message, 1, 32) == "!checkcash" then --when the player types !checkcash in the console
		local playermoney = getPlayerMoney ( source ) --set playermoney varible to player's current cash
		outputChatBox ( "Your cash: ".. playermoney ) --display their current cash in the chatbox
	end
end