GetPlayerAnnounceValue: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→See Also) |
||
(11 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function retrieves a players ASE announce value under a certain key. | {{New feature/item|3.0104|1.0.4||This function retrieves a players ASE announce value under a certain key.|}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">string getPlayerAnnounceValue ( element thePlayer, string key )</syntaxhighlight> | <syntaxhighlight lang="lua">string getPlayerAnnounceValue ( element thePlayer, string key )</syntaxhighlight> | ||
{{OOP||[[player]]:getAnnounceValue||setPlayerAnnounceValue}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''thePlayer:''' This is the [[Player]] whos value you want to retrieve. | *'''thePlayer:''' This is the [[Player]] whos value you want to retrieve. | ||
Line 14: | Line 14: | ||
==Example== | ==Example== | ||
This example adds a command named "getscore" which outputs a players "score" value to his chatbox. | This example adds a command named "getscore" which outputs a players "score" value to his chatbox. | ||
<syntaxhighlight lang="lua">function getScore ( playerSource, cmdName ) | <syntaxhighlight lang="lua">function getScore ( playerSource, cmdName ) | ||
Line 25: | Line 24: | ||
addCommandHandler ( "getscore", getScore ) | addCommandHandler ( "getscore", getScore ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Player functions}} | {{Player functions|server}} |
Latest revision as of 22:40, 6 September 2024
This function retrieves a players ASE announce value under a certain key.
Syntax
string getPlayerAnnounceValue ( element thePlayer, string key )
OOP Syntax Help! I don't understand this!
- Method: player:getAnnounceValue(...)
- Counterpart: setPlayerAnnounceValue
Required Arguments
- thePlayer: This is the Player whos value you want to retrieve.
- key: The name of the key.
Returns
This function returns a string containing the requested value if a valid key was specified or false otherwise.
Example
This example adds a command named "getscore" which outputs a players "score" value to his chatbox.
function getScore ( playerSource, cmdName ) local scoreValue = getPlayerAnnounceValue ( playerSource, "score" ) if ( scoreValue ) then outputChatBox ( "Your score: "..scoreValue, playerSource ) end end addCommandHandler ( "getscore", getScore )
See Also
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerCount
- getPlayerIdleTime
- getPlayerIP
- getPlayerVersion
- getRandomPlayer
- isPlayerMuted
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerMuted
- setPlayerScriptDebugLevel
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerScreenShot
- Shared
- 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