IsVehicleOnGround: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(OOP)
Line 7: Line 7:
bool isVehicleOnGround ( vehicle theVehicle )
bool isVehicleOnGround ( vehicle theVehicle )
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[vehicle]]:isOnGround|onGround}}
===Required Arguments===  
===Required Arguments===  
*'''theVehicle:''' The vehicle you wish to check.
*'''theVehicle:''' The vehicle you wish to check.

Revision as of 23:32, 17 December 2014

Checks to see if a vehicle has contact with the ground.

Syntax

bool isVehicleOnGround ( vehicle theVehicle )

OOP Syntax Help! I don't understand this!

Method: vehicle:isOnGround(...)
Variable: .onGround


Required Arguments

  • theVehicle: The vehicle you wish to check.

Returns

Returns true if vehicle is on the ground, false if it is not.

Example

This example tells you when you've jumped out of a vehicle.

Click to collapse [-]
Server
function checkVState ( vehicle, seat, jacked )
	vehName = getVehicleName ( vehicle )

	if isVehicleOnGround ( vehicle ) == false then
		outputChatBox ( "You jumped out of a "..vehName.."!", source, 255, 0, 0  )
	end

end
addEventHandler ( "onPlayerVehicleExit", getRootElement(), checkVState )

See Also