SetPlayerAnnounceValue: Difference between revisions
Jump to navigation
Jump to search
(Created page with '{{Server function}} __NOTOC__ This function allows you to change ASE announce values for any player using a specified key. As an example this can be used to change the "score" v…') |
m (→See Also) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 2: | Line 2: | ||
__NOTOC__ | __NOTOC__ | ||
This function allows you to change ASE announce values for any player using a specified key. | This function allows you to change ASE announce values for any player using a specified key. | ||
As an example this can be used to change the "score" value which will be shown at [ | As an example this can be used to change the "score" value which will be shown at [https://www.game-state.com/ game-state.com]'s server list. | ||
For server-wide changes you can use [[setRuleValue]]! | |||
==Syntax== | ==Syntax== | ||
Line 9: | Line 11: | ||
bool setPlayerAnnounceValue ( element thePlayer, string key, string value ) | bool setPlayerAnnounceValue ( element thePlayer, string key, string value ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[player]]:setAnnounceValue||getPlayerAnnounceValue}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''thePlayer:''' The [[player]] whos announce value you wish to change. | *'''thePlayer:''' The [[player]] whos announce value you wish to change. | ||
Line 22: | Line 24: | ||
This small example adds a command that allows you to set your own "score" value. | This small example adds a command that allows you to set your own "score" value. | ||
<syntaxhighlight lang="lua">function setScore ( playerSource, cmdName, scoreValue ) | <syntaxhighlight lang="lua">function setScore ( playerSource, cmdName, scoreValue ) | ||
if ( scoreValue ) | if ( scoreValue ) then | ||
setPlayerAnnounceValue ( playerSource, "score", scoreValue ) | setPlayerAnnounceValue ( playerSource, "score", scoreValue ) | ||
end | end | ||
Line 32: | Line 34: | ||
==See Also== | ==See Also== | ||
{{ | {{Player functions|server}} |
Latest revision as of 22:43, 6 September 2024
This function allows you to change ASE announce values for any player using a specified key. As an example this can be used to change the "score" value which will be shown at game-state.com's server list.
For server-wide changes you can use setRuleValue!
Syntax
bool setPlayerAnnounceValue ( element thePlayer, string key, string value )
OOP Syntax Help! I don't understand this!
- Method: player:setAnnounceValue(...)
- Counterpart: getPlayerAnnounceValue
Required Arguments
- thePlayer: The player whos announce value you wish to change.
- key: The key which the value will be stored at.
- value: The value you wish to store.
Returns
Returns true if the value was set succesfully, false otherwise.
Example
Click to collapse [-]
ServerThis small example adds a command that allows you to set your own "score" value.
function setScore ( playerSource, cmdName, scoreValue ) if ( scoreValue ) then setPlayerAnnounceValue ( playerSource, "score", scoreValue ) end end addCommandHandler ( "score", setScore )
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