SetAircraftMaxHeight: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Fixed spelling error and added height limit info.)
m (Error fixed)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
This function changes the maximum flying height of aircraft.
This function changes the maximum flying height of aircraft.


Line 9: Line 10:


===Required Arguments===
===Required Arguments===
*'''Height''' The height you want aircraft to be able to go. Max is 9001.
*'''Height''' The height you want aircraft to be able to go.


===Returns===
===Returns===
Line 21: Line 22:
local height = tonumber ( ve1 )
local height = tonumber ( ve1 )
if height then
if height then
if height < 9001 then
if height > 0 then
local wert = setAircraftMaxHeight ( height )
local wert = setAircraftMaxHeight ( height )
if wert == true then
if wert == true then
Line 29: Line 30:
end
end
else
else
outputChatBox ( "Maximum value is 9001", 255, 0, 0 )
outputChatBox ( "Value must be above 0", 255, 0, 0 )
end
end
else
else

Latest revision as of 14:57, 6 September 2016

This function changes the maximum flying height of aircraft.

Syntax

bool setAircraftMaxHeight ( float Height )

Required Arguments

  • Height The height you want aircraft to be able to go.

Returns

Returns true if successful, false otherwise.

Example

Click to collapse [-]
Client

This example shows you a command to set your maximum aircraft height.

function setAircraftHeight ( command, ve1 )
	local height = tonumber ( ve1 )
	if height then
		if height > 0 then
			local wert = setAircraftMaxHeight ( height )
			if wert == true then
				outputChatBox ( "Aircraft height set!", 0, 200, 0 )
			else
				outputChatBox ( "Error to set Aircraft height!", 255, 0, 0 )
			end
		else
			outputChatBox ( "Value must be above 0", 255, 0, 0 )
		end
	else
		outputChatBox ( "Error to set Aircraft height!", 255, 0, 0 )
	end
end
addCommandHandler ( "aircraft", setAircraftHeight )

See Also