GetTrainTrack: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
Line 17: Line 17:
==Example==
==Example==


<syntaxhighlight lang="lua">--TODO
<syntaxhighlight lang="lua">
addCommandHandler("getTrain",
function ()
local thePlayer = getLocalPlayer()
local theVehicle = getPedOccupiedVehicle(thePlayer)
train = getTrainTrack(theVehicle)
outputChatBox("Train Track is "..train)
end)
 
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}

Revision as of 14:43, 12 September 2015

Accessories-text-editor.png Script Example Missing Function GetTrainTrack needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.

Gets the track of a train

Syntax

int getTrainTrack ( vehicle train )

OOP Syntax Help! I don't understand this!

Method: vehicle:getTrack(...)
Variable: .track
Counterpart: getTrainTrack


Required Arguments

  • train: the train of which to get the track.

Returns

Returns an intenger which means the track of the train, false if there is problem with train element.

Example

addCommandHandler("getTrain",
function ()
	local thePlayer = getLocalPlayer()
	local theVehicle = getPedOccupiedVehicle(thePlayer)
	train = getTrainTrack(theVehicle)
	outputChatBox("Train Track is "..train)
end)

See Also