Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Fixed Spotlight issue, Fixed sound issue on server when vehicles regi…
Browse files Browse the repository at this point in the history
…stered on other clients
  • Loading branch information
dexslab authored and ejb1123 committed Mar 17, 2018
1 parent 2c9c3ef commit 225a488
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/ELS-Server/Class1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public Class1()
TriggerClientEvent("ELS:VehicleEntered", veh);
});
EventHandlers["ELS:FullSync:Unicast"] += new Action(() => { });
EventHandlers["ELS:FullSync:Broadcast"] += new Action<System.Dynamic.ExpandoObject, int>((dataDic, playerID) =>
EventHandlers["ELS:FullSync:Broadcast"] += new Action<System.Dynamic.ExpandoObject, Int16>((dataDic, playerID) =>
{
var dd = (IDictionary<string, object>)dataDic;
#if DEBUG
Expand Down
9 changes: 5 additions & 4 deletions src/Light/SpotLight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,26 @@ public void SetData(IDictionary<string, object> data)
public void RunTick()
{
Vehicle veh = new Vehicle(API.NetworkGetEntityFromNetworkId(_veh));
if (Game.IsControlPressed(0, Control.PhoneLeft))
Utils.DebugWriteLine($"Spotlight veh handle of {veh.Handle}");
if (Game.IsControlPressed(0, Control.PhoneLeft) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == veh.GetNetworkId())
{
RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightLeft, veh, true, Game.Player.ServerId);
anglehorizontal++;

}
if (Game.IsControlPressed(0, Control.PhoneRight))
if (Game.IsControlPressed(0, Control.PhoneRight) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == veh.GetNetworkId())
{

RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightRight, veh, true, Game.Player.ServerId);
anglehorizontal--;
}
if (Game.IsControlPressed(0, Control.PhoneUp))
if (Game.IsControlPressed(0, Control.PhoneUp) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == veh.GetNetworkId())
{

RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightUp, veh, true, Game.Player.ServerId);
angleVertical++;
}
if (Game.IsControlPressed(0, Control.PhoneDown))
if (Game.IsControlPressed(0, Control.PhoneDown) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == veh.GetNetworkId())
{

RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightDown, veh, true, Game.Player.ServerId);
Expand Down

0 comments on commit 225a488

Please sign in to comment.