GetVehiclePanelState: 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__
{{Needs Checking|A list of panels would be nice and a more specific explanation on what the function returns --[[User:Norby89|Norby89]] 12:30, 26 August 2007 (CDT)}}
{{Server client function}}
{{Server client function}}
__NOTOC__
This function returns the current state of a specifed panel on the vehicle. A vehicle can have up to 7 panels.
<!-- Describe in plain english what this function does. Don't go into details, just give an overview -->
This fake function is for use with blah & blah and does blahblahblabhalbhl


==Syntax==  
==Syntax==  
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
int getVehiclePanelState ( vehicle thevehicle, int panel )
int getVehiclePanelState ( vehicle thevehicle, int panel )
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
==Required Arguments==
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type -->
*'''theVehicle:''' A handle to the [[vehicle]] that you wish to know the panel state of.
*'''argumentName:''' description
*'''panel:''' A whole number ranging from 0 to 6.
<!-- Only include this section below if there are optional arguments -->
 
===Optional Arguments===  
==Returns==
{{OptionalArg}}
Returns an [[int]] indicating the state of the specified the panel. This value can be:
*'''argumentName2:''' description
 
*'''argumentName3:''' description
NEEDS UPDATING


===Returns===
==Example==
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check -->
This function creates an admiral and outputs every panel's state in the chatbox.
*Returns ''true'' if blah, ''false'' otherwise.
<syntaxhighlight lang="lua">local newcar = createVehicle ( 520, 1024, 1024, 1024 )
*returns state as integer for the panel
admiral = createVehicle ( 445, 0, 0, 10 )


==Example==
...
<!-- Explain what the example is in a single sentance -->
 
This example does...
for i=0, 6 do
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
  local panel = getVehiclePanelState ( admiral, i )
<syntaxhighlight lang="lua">
    outputChatBox ( panel )
--This line does...
end
blabhalbalhb --abababa
--This line does this...
mooo
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
{{Vehicle functions}}
{{FunctionArea_functions}}
[[Category:Incomplete]] -- leave this unless you complete the function

Revision as of 17:30, 26 August 2007


Dialog-information.png This article needs checking.

Reason(s): A list of panels would be nice and a more specific explanation on what the function returns --Norby89 12:30, 26 August 2007 (CDT)

This function returns the current state of a specifed panel on the vehicle. A vehicle can have up to 7 panels.

Syntax

int getVehiclePanelState ( vehicle thevehicle, int panel )

Required Arguments

  • theVehicle: A handle to the vehicle that you wish to know the panel state of.
  • panel: A whole number ranging from 0 to 6.

Returns

Returns an int indicating the state of the specified the panel. This value can be:

NEEDS UPDATING

Example

This function creates an admiral and outputs every panel's state in the chatbox.

local newcar = createVehicle ( 520, 1024, 1024, 1024 )
admiral = createVehicle ( 445, 0, 0, 10 )

...

for i=0, 6 do
  local panel = getVehiclePanelState ( admiral, i )
    outputChatBox ( panel )
end

See Also