Vehicles/VehicleScripts/NetworkEvents/EventVehicleMotorCruisControlEnable.lua

This file contains an event that triggers the cruise control implemented in Vehicle.

  25  EventVehicleCruiseControlEnable         = EventVehicleCruiseControlEnable or ExtensionOf(BaseEvent);
  26  
  27  InitVanillaEvent(EventVehicleCruiseControlEnable, "EventVehicleCruiseControlEnable");
  28  
  29  function EventVehicleCruiseControlEnable:sendData(entity, isEnabled)
  30      streamWriteEntityId(entity);
  31      streamWriteBool(isEnabled);
  32  end;
  33  
  34  function EventVehicleCruiseControlEnable:receiveData(connection)
  35      if g_isMaster then
  36          local entity                = streamReadEntityId();
  37          local isEnabled             = streamReadBool();
  38  
  39          if entity ~= nil then
  40              entity:setCruiseControlEnabled(isEnabled, true);
  41          end;
  42      end;
  43  end;

All contents of this page may be used for modding use for Winter Resort Simulator - Season 2 only. Any use exceeding this regulation is not permitted.

Copyright (C) HR Innoways, 2021. All Rights Reserved.