SetHeliBladeCollisionsEnabled

From Multi Theft Auto: Wiki
Revision as of 22:49, 12 September 2013 by XFawkes (talk | contribs) (Created page with "__NOTOC__ {{Server client function}} This function changes the state of the helicopter blades collisions on the specified vehicle. ==Syntax== <syntaxhighlight lang="lua"> bool setHeliBladeCo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function changes the state of the helicopter blades collisions on the specified vehicle.

Syntax

bool setHeliBladeCollisionsEnabled ( vehicle theVehicle , bool collisions )

Required Arguments

  • theVehicle: The vehicle that will have the sirens set
  • collisions: The state of the helicopter blades collisions

Returns

Returns true if the collisions are set for the specified vehicle, false if the collisions can't be set for the specified vehicle, if the vehicle is not a helicopter or if invalid arguments are specified.

Example

Click to collapse [-]
Server

This example disables blades collisions when a player enters a helicopter as a driver.

function onVehicleEnter ( thePlayer, seat, jacked )
	--If the player entered a helicopter
	if ( table.find({425,487,488,497,563,447,469},getElementModel(source)) ) then
		--If the player entered as a driver
		if ( seat == 0 ) then
			--If blade collisions were off
			if not getHeliBladeCollisionsEnabled( source ) then
				setHeliBladeCollisionsEnabled( source, true )
			else
				setHeliBladeCollisionsEnabled( source, false )
			end
		end
	end
end
addEventHandler ( "onVehicleEnter", root, onVehicleEnter )

See Also