Vehicles/VehicleScripts/NetworkEvents/EventSnowGroomer.lua

This file contains all event that are relevant for the SnowGroomer.

  25  
  26  EventSetSnowGroomerPosition         = EventSetSnowGroomerPosition or ExtensionOf(BaseEvent);
  27  
  28  InitVanillaEvent(EventSetSnowGroomerPosition, "EventSetSnowGroomerPosition");
  29  
  30  function EventSetSnowGroomerPosition:sendData(entity, isLowered)
  31      streamWriteEntityId(entity);
  32      streamWriteBool(isLowered);
  33  end;
  34  
  35  function EventSetSnowGroomerPosition:receiveData(connection)
  36      local entity                    = streamReadEntityId();
  37      local isLowered                 = streamReadBool();
  38  
  39      if entity ~= nil then
  40          entity:setIsSnowGroomerIsLowered(isLowered, true);
  41      end;
  42      
  43      self:broadcastEvent(connection, entity, isLowered);
  44  end;
  45  
  46  
  47  EventSetSnowGroomerLocked           = EventSetSnowGroomerLocked or ExtensionOf(BaseEvent);
  48  
  49  InitVanillaEvent(EventSetSnowGroomerLocked, "EventSetSnowGroomerLocked");
  50  
  51  function EventSetSnowGroomerLocked:sendData(entity, isLocked)
  52      streamWriteEntityId(entity);
  53      streamWriteBool(isLocked);
  54  end;
  55  
  56  function EventSetSnowGroomerLocked:receiveData(connection)
  57      local entity                    = streamReadEntityId();
  58      local isLocked                  = streamReadBool();
  59      
  60      if entity ~= nil then
  61          entity:setIsSnowGroomerIsLocked(isLocked, true);
  62      end;
  63      
  64      self:broadcastEvent(connection, entity, isLocked);
  65  end;
  66  
  67  EventSetSnowGroomerFlaps            = EventSetSnowGroomerFlaps or ExtensionOf(BaseEvent);
  68  
  69  InitVanillaEvent(EventSetSnowGroomerFlaps, "EventSetSnowGroomerFlaps");
  70  
  71  function EventSetSnowGroomerFlaps:sendData(entity, leftFlap, rightFlap)
  72      streamWriteEntityId(entity);
  73      streamWriteBool(leftFlap);
  74      streamWriteBool(rightFlap);
  75  end;
  76  
  77  function EventSetSnowGroomerFlaps:receiveData(connection)
  78      local entity                    = streamReadEntityId();
  79      local leftFlap                  = streamReadBool();
  80      local rightFlap                 = streamReadBool();
  81      
  82      if entity ~= nil then
  83          entity:setSnowGroomerFlaps(leftFlap, rightFlap, true);
  84      end;
  85      
  86      self:broadcastEvent(connection, entity, leftFlap, rightFlap);
  87  end;
  88  
  89  EventSetSnowGroomerRotation         = EventSetSnowGroomerRotation or ExtensionOf(BaseEvent);
  90  
  91  InitVanillaEvent(EventSetSnowGroomerRotation, "EventSetSnowGroomerRotation");
  92  
  93  function EventSetSnowGroomerRotation:sendData(entity, rot)
  94      streamWriteEntityId(entity);
  95      streamWriteFloat(rot);
  96  end;
  97  
  98  function EventSetSnowGroomerRotation:receiveData(connection)
  99      local entity                    = streamReadEntityId();
 100      local rot                       = streamReadFloat();
 101  
 102      
 103      if entity ~= nil then
 104          entity:setSnowGroomerRotation(rot, true);
 105      end;
 106      
 107      self:broadcastEvent(connection, entity, rot);
 108  end;
 109  
 110  
 111  

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.