Vehicles/VehicleScripts/NetworkEvents/EventRefuelVehicle.lua

This file contains an event that triggers refueling the FuelTank of a client's vehicle.

  25  EventRefuelVehicle              = EventRefuelVehicle or ExtensionOf(BaseEvent);
  26  
  27  InitVanillaEvent(EventRefuelVehicle, "EventRefuelVehicle");
  28  
  29  function EventRefuelVehicle:sendData(entity, isRefuelling)
  30      streamWriteEntityId(entity);
  31      streamWriteBool(isRefuelling);
  32  end;
  33  
  34  function EventRefuelVehicle:receiveData(connection)
  35      local entity                    = streamReadEntityId();
  36      local isRefuelling              = streamReadBool();
  37  
  38      if entity ~= nil then
  39          entity:setIsRefuelling(isRefuelling, true);
  40      end;
  41      
  42      --self:broadcastEvent(connection, entity, key, value);
  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.