GetTrainTrack: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Little mistake)
m (fix oop)
Line 7: Line 7:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">int getTrainTrack ( vehicle train )</syntaxhighlight>
<syntaxhighlight lang="lua">int getTrainTrack ( vehicle train )</syntaxhighlight>
{{OOP||[[vehicle]]:getTrack|track|getTrainTrack}}
{{OOP||[[vehicle]]:getTrack|track|setTrainTrack}}
===Required Arguments===
===Required Arguments===
*'''train:''' the train of which to get the track.
*'''train:''' the train of which to get the track.

Revision as of 00:44, 13 September 2015

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: setTrainTrack


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