SetAircraftMaxHeight: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function changes the maximum flying height of aircraft. ==Syntax== <syntaxhighlight lang="lua"> bool setAircraftMaxHeight ( float Height ) </syntaxhighlight> ===R...")
 
m (Fixed spelling error and added height limit info.)
Line 9: Line 9:


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


===Returns===
===Returns===
Line 21: Line 21:
local height = tonumber ( ve1 )
local height = tonumber ( ve1 )
if height then
if height then
local wert = setAircraftMaxHeight ( height )
if height < 9001 then
if wert == true then
local wert = setAircraftMaxHeight ( height )
outputChatBox ( "Aircraft heigt seted!", 0, 200, 0 )
if wert == true then
outputChatBox ( "Aircraft height set!", 0, 200, 0 )
else
outputChatBox ( "Error to set Aircraft height!", 255, 0, 0 )
end
else
else
outputChatBox ( "Error to set Aircraft heigt!", 255, 0, 0 )  
outputChatBox ( "Maximum value is 9001", 255, 0, 0 )
end
end
else
else
outputChatBox ( "Error to set Aircraft heigt!", 255, 0, 0 )  
outputChatBox ( "Error to set Aircraft height!", 255, 0, 0 )
end
end
end
end

Revision as of 09:38, 15 June 2011

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. Max is 9001.

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 < 9001 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 ( "Maximum value is 9001", 255, 0, 0 )
		end
	else
		outputChatBox ( "Error to set Aircraft height!", 255, 0, 0 )
	end
end
addCommandHandler ( "aircraft", setAircraftHeight )

See Also