IsPlayerDoingTask

From Multi Theft Auto: Wiki
Revision as of 14:45, 17 October 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function checks if the specified player is carrying out a certain task.

Syntax

bool isPlayerDoingTask ( player thePlayer, string taskName )

Required Arguments

  • thePlayer: A player object referencing the specified player.
  • taskName: A string containing the name of the task you're checking for.

Returns

Returns true if the player is currently doing the task.

Example

This example forces a players radar-map on for 10seconds if it hasnt been already

addCommandHandler ( "amIDoingADriveby", "amIDoingADriveby" )
function amIDoingADriveby ( source, key )
  if ( isPlayerDoingTask ( source, "TASK_SIMPLE_GANG_DRIVEBY" ) ) then
    outputChatBox ( getClientName ( source ) .. " is doing a driveby!!!" )
  else
    outputChatBox ( getClientName ( source ) .. " is not doing a driveby" )
  end
end

See Also