GetPlayerSimplestTask: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
This function is used to get the name of a specified players current simplest task.
This function is used to get the name of a specified players current simplest [[task]].


==Syntax==
==Syntax==
Line 8: Line 8:


===Required Arguments===
===Required Arguments===
*'''thePlayer''': The [[player]] whose task you want to retrieve.
*'''thePlayer''': The [[player]] whose [[task]] you want to retrieve.


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


==Example==
==Example==
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 ( "simplest_task", "task" )
addCommandHandler ( "stask", stask" )
function task ( source, key )
function task ( source, key )
   thetask = getPlayerSimplestTask ( source )
   thetask = getPlayerSimplestTask ( source )

Revision as of 12:08, 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.

addCommandHandler ( "stask", stask" )
function task ( source, key )
  thetask = getPlayerSimplestTask ( source )
  outputChatBox ( getClientName ( source ) .. "'s simplest task is: " .. thetask )
end    

See Also