Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop
This commit is contained in:
@@ -8,12 +8,22 @@ namespace reallife_gamemode.Server.Managers
|
||||
{
|
||||
public class TimeManager
|
||||
{
|
||||
private static Timer realTimeTimer;
|
||||
|
||||
public static void StartTimeManager()
|
||||
{
|
||||
Timer t = new Timer(1000);
|
||||
t.Elapsed += SetTime;
|
||||
if(realTimeTimer == null)
|
||||
{
|
||||
realTimeTimer = new Timer(1000);
|
||||
realTimeTimer.Elapsed += SetTime;
|
||||
}
|
||||
|
||||
t.Start();
|
||||
realTimeTimer.Start();
|
||||
}
|
||||
|
||||
public static void PauseTimeManager()
|
||||
{
|
||||
realTimeTimer.Stop();
|
||||
}
|
||||
|
||||
private static void SetTime(object sender, ElapsedEventArgs args)
|
||||
|
||||
@@ -47,17 +47,23 @@ namespace reallife_gamemode.Server.Managers
|
||||
|
||||
|
||||
veh.SetSharedData("mod18", false);
|
||||
veh.SetSharedData("mod22", false);
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
foreach(VehicleMod vMod in dbContext.VehicleMods.ToList().FindAll(vM => vM.ServerVehicleId == sVeh.Id))
|
||||
{
|
||||
if(vMod.Slot == 18 || vMod.Slot == 22)
|
||||
if(vMod.Slot == 18)
|
||||
{
|
||||
veh.SetSharedData("mod" + vMod.Slot, true);
|
||||
}
|
||||
veh.SetMod(vMod.Slot, vMod.ModId - 1);
|
||||
else if(vMod.Slot == 22)
|
||||
{
|
||||
int color = vMod.ModId - 2;
|
||||
if (vMod.ModId == 0) color = -1;
|
||||
if (vMod.ModId == 1) color = 13;
|
||||
veh.SetSharedData("headlightColor", color);
|
||||
}
|
||||
else veh.SetMod(vMod.Slot, vMod.ModId - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,13 +89,24 @@ namespace reallife_gamemode.Server.Managers
|
||||
Vehicle pV = player.Vehicle;
|
||||
if (index == 0) index--;
|
||||
|
||||
if(slot != 18 && slot != 22)
|
||||
if(slot != 18)
|
||||
{
|
||||
pV.SetMod(slot, index - 1);
|
||||
if(slot == 22)
|
||||
{
|
||||
int color = index - 2;
|
||||
if (index == 0) color = -1;
|
||||
if (index == 1) color = 13;
|
||||
pV.SetSharedData("headlightColor", color);
|
||||
}
|
||||
else
|
||||
{
|
||||
pV.SetMod(slot, index - 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bool newVal = index == -1 ? false : true;
|
||||
NAPI.Util.ConsoleOutput("Setting turbo to: " + newVal.ToString());
|
||||
pV.SetSharedData("mod" + slot, newVal);
|
||||
NAPI.ClientEvent.TriggerClientEventForAll("vehicleToggleMod", pV, slot, newVal);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,53 @@ namespace reallife_gamemode.Server.Managers
|
||||
{
|
||||
private static readonly List<string> _enabledMods = new List<string>()
|
||||
{
|
||||
"polamggtr"
|
||||
"polamggtr",
|
||||
"impaler3",
|
||||
"monster4",
|
||||
"monster5",
|
||||
"slamvan6",
|
||||
"issi6",
|
||||
"cerberus2",
|
||||
"cerberus3",
|
||||
"deathbike2",
|
||||
"dominator6",
|
||||
"deathbike3",
|
||||
"impaler4",
|
||||
"slamvan4",
|
||||
"slamvan5",
|
||||
"brutus",
|
||||
"brutus2",
|
||||
"brutus3",
|
||||
"deathbike",
|
||||
"dominator4",
|
||||
"dominator5",
|
||||
"bruiser",
|
||||
"bruiser2",
|
||||
"bruiser3",
|
||||
"rcbandito",
|
||||
"italigto",
|
||||
"cerberus",
|
||||
"impaler2",
|
||||
"monster3",
|
||||
"tulip",
|
||||
"scarab",
|
||||
"scarab2",
|
||||
"scarab3",
|
||||
"issi4",
|
||||
"issi5",
|
||||
"clique",
|
||||
"deveste",
|
||||
"vamos",
|
||||
"imperator",
|
||||
"imperator2",
|
||||
"imperator3",
|
||||
"toros",
|
||||
"deviant",
|
||||
"schlagen",
|
||||
"impaler",
|
||||
"zr380",
|
||||
"zr3802",
|
||||
"zr3803"
|
||||
};
|
||||
|
||||
private static Dictionary<int, NetHandle> _serverVehicles = new Dictionary<int, NetHandle>();
|
||||
|
||||
Reference in New Issue
Block a user