IsPlayerOnGround: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 14: Line 14:
<syntaxhighlight lang="lua"> [lua]
<syntaxhighlight lang="lua"> [lua]
addCommandHandler ( "amiflying", "isHeFlying" )
addCommandHandler ( "amiflying", "isHeFlying" )
function isHeSuperman ( source, key )
function isHeFlying ( source, key )
   if ( isPlayerOnGround ( source ) ) then
   if ( isPlayerOnGround ( source ) ) then
     outputChatBox ( "no, you're not flying, you're just stoned!" )
     outputChatBox ( "no, you're not flying, you're just stoned!" )

Revision as of 18:14, 14 August 2006

This function is used to determine whether or not a player is on the ground.

Syntax

bool isPlayerOnGround ( player thePlayer )

Required Arguments

  • player: The player you are checking.

Returns

Returns true if the player is on the ground, 'false' otherwise.

Example

 [lua]
addCommandHandler ( "amiflying", "isHeFlying" )
function isHeFlying ( source, key )
  if ( isPlayerOnGround ( source ) ) then
    outputChatBox ( "no, you're not flying, you're just stoned!" )
  else
    outputChatBox ( "is it a bird, is it a plane.. no its " .. getClientName ( source ) )
  end
end

See Also