IsPlayerDoingTask: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
This function checks if the specified player is carrying out a certain [[List of player tasks|task]]. | This function checks if the specified player is carrying out a certain [[List of player tasks|task]]. | ||
==Syntax== | ==Syntax (clientside)== | ||
<syntaxhighlight lang="lua">bool isPlayerDoingTask ( player thePlayer, string taskName )</syntaxhighlight> | <syntaxhighlight lang="lua">bool isPlayerDoingTask ( player thePlayer, string taskName )</syntaxhighlight> | ||
Revision as of 20:28, 30 July 2007
This function checks if the specified player is carrying out a certain task.
Syntax (clientside)
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, false otherwise.
Example
This example checks if the player who entered the 'doingdriveby' command is doing a drive-by (clientside).
function amIDoingADriveby () if ( isPlayerDoingTask ( getLocalPlayer(), "TASK_SIMPLE_GANG_DRIVEBY" ) ) then outputChatBox ( getPlayerName ( getLocalPlayer() ) .. " is doing a driveby!!!" ) else outputChatBox ( getPlayerName ( getLocalPlayer() ) .. " is not doing a driveby" ) end end addCommandHandler ( "doingdriveby", amIDoingADriveby )
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState