GetPlayerAnnounceValue: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 6: Line 6:
==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||}}
{{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.

Revision as of 22:59, 28 December 2014

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

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