GivePlayerMoney: Difference between revisions
Jump to navigation
Jump to search
(example - onConsole -> command handlers) |
|||
Line 11: | Line 11: | ||
==Example== | ==Example== | ||
This example gives a player money when he types "givecash" in console | This example gives a player money when he types "givecash" in console | ||
<syntaxhighlight lang="lua">addCommandHandler ( "givecash", "giveCash" ) --add the command " | <syntaxhighlight lang="lua">addCommandHandler ( "givecash", "giveCash" ) --add the command "givecash" | ||
function giveCash ( player, command, amount ) --when the | function giveCash ( player, command, amount ) --when the givecash command is called | ||
givePlayerMoney ( player, amount ) -- | givePlayerMoney ( player, amount ) --gives the player money according to the amount | ||
end</syntaxhighlight> | end</syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Player functions}} | {{Player functions}} |
Revision as of 01:56, 25 April 2007
Adds money to the player's current money amount.
Syntax
givePlayerMoney ( 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 gives a player money when he types "givecash" in console
addCommandHandler ( "givecash", "giveCash" ) --add the command "givecash" function giveCash ( player, command, amount ) --when the givecash command is called givePlayerMoney ( player, amount ) --gives the player 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