ToggleVehicleRespawn

From Multi Theft Auto: Wiki
Revision as of 15:34, 20 June 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

This function toggles whether or not the vehicle will be respawned after blown or idle.

Syntax

bool toggleVehicleRespawn ( vehicle theVehicle, bool Respawn )

Required Arguments

  • theVehicle: The vehicle you wish to toggle the respawning of.
  • Respawn: A boolean determining if the vehicle will respawn or not.

Returns

Returns 'true' if the vehicle was found and edited.

Example

addEventHandler ( "onPlayerConsole", root, "onPlayerConsole" )
function onPlayerConsole ( text )
  command = gettok ( text, 1, 32 )
  if ( command == "doNotRespawn" ) then
    vehicle = getPlayerOccupiedVehicle ( source )
    if ( vehicle ) then
      toggleVehicleRespawn ( vehicle, false ) -- tell the server not to respawn this vehicle
    end
  end
end

See Also