getPlayerAnnounceValue | Multi Theft Auto: Wiki Skip to content

getPlayerAnnounceValue

Client-side
Server-side
Shared

Pair: setPlayerAnnounceValue

Manual Review Required

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


This function retrieves a players ASE announce value under a certain key.

OOP Syntax Help! I don't understand this!

  • Method:player:getAnnounceValue(...)

Syntax

string getPlayerAnnounceValue ( element thePlayer, string key )
Required Arguments
  • thePlayer: This is the Player whos value you want to retrieve.
  • key: The name of the key.

Returns

  • string: value

This function returns a string containing the requested value if a valid key was specified or false otherwise.

Code Examples

shared

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