IsVehicleLocked: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Server client function}}
__NOTOC__
__NOTOC__
This will tell you if a vehicle is locked.
This will tell you if a vehicle is locked.
Line 6: Line 7:


===Required Arguments===
===Required Arguments===
*'''theVehicle''': The [[vehicle]] that you need to obtain the locked status of.
*'''theVehicle:''' The [[vehicle]] that you want to obtain the locked status of.


===Returns===
===Returns===
Line 12: Line 13:


==Example==
==Example==
This example creates a vehicle then displays if it is locked or not in the chatbox (vehicles are created unlocked).
This example creates a vehicle, then displays if it is locked or not in the chatbox (vehicles are created unlocked).
<syntaxhighlight lang="lua">newcar = createVehicle ( 520, 1024, 1024, 1024 )
<syntaxhighlight lang="lua">
newcar = createVehicle ( 520, 1024, 1024, 1024 )
if isVehicleLocked ( newcar )
if isVehicleLocked ( newcar )
  outputChatBox ( "Vehicle is locked." )
    outputChatBox ( "Vehicle is locked." )
else
else
  outputChatBox ( "Vehicle is unlocked." )
    outputChatBox ( "Vehicle is unlocked." )
end</syntaxhighlight>
end
</syntaxhighlight>


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

Revision as of 19:13, 16 August 2007

This will tell you if a vehicle is locked.

Syntax

bool isVehicleLocked ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle that you want to obtain the locked status of.

Returns

Returns true if the vehicle specified is locked, false if is unlocked or the vehicle specified is invalid.

Example

This example creates a vehicle, then displays if it is locked or not in the chatbox (vehicles are created unlocked).

newcar = createVehicle ( 520, 1024, 1024, 1024 )
if isVehicleLocked ( newcar )
    outputChatBox ( "Vehicle is locked." )
else
    outputChatBox ( "Vehicle is unlocked." )
end

See Also