IsPlayerOnGround: 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 determine whether or not a player is on the ground.
{{Server client function}}
This function is used to determine whether or not a player is on the ground. This is for on-foot usage only.


==Syntax==
==Syntax==

Revision as of 12:04, 7 August 2007

This function is used to determine whether or not a player is on the ground. This is for on-foot usage only.

Syntax

bool isPlayerOnGround ( player thePlayer )

Required Arguments

  • thePlayer: The player you are checking.

Returns

Returns true if the player is on the ground, false otherwise and if he is in a vehicle capable of flying.

Example

This examle checks if the player who enters the 'amiflying' command is on the ground and outputs a message

 [lua]
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
addCommandHandler ( "amiflying", isHeFlying )

See Also