GetPlayerSimplestTask: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:
This example prints the name of a players simplest task to the chat, when they use the "simplest_task" command.
This example prints the name of a players simplest task to the chat, when they use the "simplest_task" command.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler ( "stask", stask" )
function showSTask ()
function task ( source, key )
   local thetask = getPlayerSimplestTask ( getLocalPlayer() )
   thetask = getPlayerSimplestTask ( source )
   outputChatBox ( getPlayerName ( getLocalPlayer() ) .. "'s simplest task is: " .. thetask )
   outputChatBox ( getClientName ( source ) .. "'s simplest task is: " .. thetask )
end
end  
addCommandHandler ( "sTask", showSTask )
 
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Player functions}}
{{Player functions}}

Revision as of 12:09, 29 July 2007

This function is used to get the name of a specified players current simplest task.

Syntax

string getPlayerSimplestTask ( player thePlayer )

Required Arguments

  • thePlayer: The player whose task you want to retrieve.

Returns

Returns a string representing the name of the player's simplest, active task.

Example

This example prints the name of a players simplest task to the chat, when they use the "simplest_task" command.

function showSTask ()
  local thetask = getPlayerSimplestTask ( getLocalPlayer() )
  outputChatBox ( getPlayerName ( getLocalPlayer() ) .. "'s simplest task is: " .. thetask )
end
addCommandHandler ( "sTask", showSTask )

See Also