IsVehicleRespawnable: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Server function}} __NOTOC__ {{Added feature/item|1.6.1|1.6.0|22505|This function check if the vehicle is respawnable.}} ==Syntax== <syntaxhighlight lang="lua"> bool isVehicleRespawnable ( vehicle theVehicle ) </syntaxhighlight> {{OOP||vehicle:isRespawnable}} ===Required Arguments=== *'''theVehicle:''' The vehicle which you'd like to get respawn state of. ===Returns=== Returns three '''true''' if the vehicle is respawnable, '''false''' otherwise. ==Example==...")
 
m (Added OOP variable and setter)
Line 7: Line 7:
bool isVehicleRespawnable ( vehicle theVehicle )
bool isVehicleRespawnable ( vehicle theVehicle )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[vehicle]]:isRespawnable}}
{{OOP||[[vehicle]]:isRespawnable|respawnable|toggleVehicleRespawn}}


===Required Arguments===
===Required Arguments===

Revision as of 10:01, 9 June 2024

BETA: NEW FEATURE (BUILD: 1.6.0 r22505)
This function check if the vehicle is respawnable.

Syntax

bool isVehicleRespawnable ( vehicle theVehicle )

OOP Syntax Help! I don't understand this!

Method: vehicle:isRespawnable(...)
Variable: .respawnable
Counterpart: toggleVehicleRespawn


Required Arguments

  • theVehicle: The vehicle which you'd like to get respawn state of.

Returns

Returns three true if the vehicle is respawnable, false otherwise.

Example

This example toggles all vehicles respawnability

Click to collapse [-]
Server
addCommandHandler("toggleRespawn",function(player)
    for _,vehicle in ipairs(getElementsByType('vehicle')) do
        toggleVehicleRespawn(vehicle, not isVehicleRespawnable(vehicle))
    end

    outputChatBox('Vehicles respawn state has been changed!', player)
end)

See Also