Miese Corona Zeiten push für Lenhardt
This commit is contained in:
@@ -1,106 +1,108 @@
|
||||
using System.Collections.Generic;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using GTANetworkAPI;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public class CheckPointHandle : Script
|
||||
{
|
||||
public static List<CheckPointListForPlayer> listHandle = new List<CheckPointListForPlayer>();
|
||||
|
||||
public static void DeleteCheckpoints(Player player)
|
||||
{
|
||||
RemovePlayerHandlerFromList(player);
|
||||
player.TriggerEvent("destroyCP");
|
||||
}
|
||||
public static List<CheckPointListForPlayer> listHandle = new List<CheckPointListForPlayer>();
|
||||
|
||||
public static void StartCheckPointRoute(Player player, IEnumerable<Vector3> nListCps, int delay, int markerID, int markerSize, string nEvent)
|
||||
{
|
||||
RemovePlayerHandlerFromList(player);
|
||||
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps, delay, markerID, markerSize, nEvent);
|
||||
playerHandle.DeleteCheckpoints();
|
||||
|
||||
listHandle.Add(playerHandle);
|
||||
|
||||
playerHandle.StartRoute();
|
||||
}
|
||||
public static void RemovePlayerHandlerFromList(Player player)
|
||||
{
|
||||
CheckPointListForPlayer temp = null;
|
||||
for (int a = 0; a < listHandle.Count; a++)
|
||||
{
|
||||
temp = listHandle[a];
|
||||
if (temp.player == player)
|
||||
public static void DeleteCheckpoints(Player player)
|
||||
{
|
||||
listHandle.Remove(temp);
|
||||
RemovePlayerHandlerFromList(player);
|
||||
player.TriggerEvent("destroyCP");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("playerInCheckpoint")]
|
||||
public void PlayerInCheckpoint(Player user)
|
||||
{
|
||||
CheckPointListForPlayer temp = null;
|
||||
for (int a = 0; a < listHandle.Count; a++)
|
||||
{
|
||||
temp = listHandle[a];
|
||||
if (temp.player == user)
|
||||
public static void StartCheckPointRoute(Player player, IEnumerable<Vector3> nListCps, int delay, int markerID, int markerSize, string nEvent)
|
||||
{
|
||||
break;
|
||||
RemovePlayerHandlerFromList(player);
|
||||
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps, delay, markerID, markerSize, nEvent);
|
||||
playerHandle.DeleteCheckpoints();
|
||||
|
||||
listHandle.Add(playerHandle);
|
||||
|
||||
playerHandle.StartRoute();
|
||||
}
|
||||
|
||||
public static void RemovePlayerHandlerFromList(Player player)
|
||||
{
|
||||
CheckPointListForPlayer temp = null;
|
||||
for (int a = 0; a < listHandle.Count; a++)
|
||||
{
|
||||
temp = listHandle[a];
|
||||
if (temp.player == player)
|
||||
{
|
||||
listHandle.Remove(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("playerInCheckpoint")]
|
||||
public void PlayerInCheckpoint(Player user)
|
||||
{
|
||||
CheckPointListForPlayer temp = null;
|
||||
for (int a = 0; a < listHandle.Count; a++)
|
||||
{
|
||||
temp = listHandle[a];
|
||||
if (temp.player == user)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
temp.NextCheckpoint();
|
||||
}
|
||||
}
|
||||
temp.NextCheckpoint();
|
||||
}
|
||||
}
|
||||
|
||||
public class CheckPointListForPlayer
|
||||
{
|
||||
public IEnumerable<Vector3> list = new List<Vector3>();
|
||||
public Player player;
|
||||
public int delay = 0;
|
||||
public int markerID;
|
||||
public int markerSize;
|
||||
public string eventInCheckpoint = "";
|
||||
public class CheckPointListForPlayer
|
||||
{
|
||||
public IEnumerable<Vector3> list = new List<Vector3>();
|
||||
public Player player;
|
||||
public int delay = 0;
|
||||
public int markerID;
|
||||
public int markerSize;
|
||||
public string eventInCheckpoint = "";
|
||||
|
||||
int checkPointsDone = 0;
|
||||
private int checkPointsDone = 0;
|
||||
|
||||
public CheckPointListForPlayer(Player nPlayer, IEnumerable<Vector3> nList, int nDelay, int nMarkerID, int nMarkerSize, string nEvent)
|
||||
{
|
||||
this.player = nPlayer;
|
||||
this.list = nList;
|
||||
this.delay = nDelay;
|
||||
this.markerID = nMarkerID;
|
||||
this.markerSize = nMarkerSize;
|
||||
this.eventInCheckpoint = nEvent;
|
||||
this.checkPointsDone = 0;
|
||||
}
|
||||
|
||||
public void StartRoute()
|
||||
{
|
||||
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player, 0, this.delay, this.markerID, this.markerSize, this.eventInCheckpoint);
|
||||
}
|
||||
public void NextCheckpoint()
|
||||
{
|
||||
this.checkPointsDone++;
|
||||
if (this.list.Count() > checkPointsDone)
|
||||
{
|
||||
Vector3 nextCp = list.ElementAt(checkPointsDone);
|
||||
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.eventInCheckpoint);
|
||||
}
|
||||
if (this.list.Count() == checkPointsDone)
|
||||
{
|
||||
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
|
||||
|
||||
if (this.eventInCheckpoint == "busDriverJob")
|
||||
{
|
||||
Job.BusDriverJob.payWage(this.player, 1000);
|
||||
this.player = nPlayer;
|
||||
this.list = nList;
|
||||
this.delay = nDelay;
|
||||
this.markerID = nMarkerID;
|
||||
this.markerSize = nMarkerSize;
|
||||
this.eventInCheckpoint = nEvent;
|
||||
this.checkPointsDone = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteCheckpoints()
|
||||
{
|
||||
this.player.TriggerEvent("destroyCP");
|
||||
public void StartRoute()
|
||||
{
|
||||
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player, 0, this.delay, this.markerID, this.markerSize, this.eventInCheckpoint);
|
||||
}
|
||||
|
||||
public void NextCheckpoint()
|
||||
{
|
||||
this.checkPointsDone++;
|
||||
if (this.list.Count() > checkPointsDone)
|
||||
{
|
||||
Vector3 nextCp = list.ElementAt(checkPointsDone);
|
||||
this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.eventInCheckpoint);
|
||||
}
|
||||
if (this.list.Count() == checkPointsDone)
|
||||
{
|
||||
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
|
||||
|
||||
if (this.eventInCheckpoint == "busDriverJob")
|
||||
{
|
||||
Job.BusDriverJob.payWage(this.player, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteCheckpoints()
|
||||
{
|
||||
this.player.TriggerEvent("destroyCP");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +1,37 @@
|
||||
using GTANetworkAPI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public class Converter
|
||||
{
|
||||
public static Color HexToColor(string hexColor)
|
||||
{
|
||||
//Remove # if present
|
||||
if (hexColor.IndexOf('#') != -1)
|
||||
hexColor = hexColor.Replace("#", "");
|
||||
public static Color HexToColor(string hexColor)
|
||||
{
|
||||
//Remove # if present
|
||||
if (hexColor.IndexOf('#') != -1)
|
||||
hexColor = hexColor.Replace("#", "");
|
||||
|
||||
int red = 0;
|
||||
int green = 0;
|
||||
int blue = 0;
|
||||
int red = 0;
|
||||
int green = 0;
|
||||
int blue = 0;
|
||||
|
||||
if (hexColor.Length == 6)
|
||||
{
|
||||
//#RRGGBB
|
||||
red = int.Parse(hexColor.Substring(0, 2), NumberStyles.AllowHexSpecifier);
|
||||
green = int.Parse(hexColor.Substring(2, 2), NumberStyles.AllowHexSpecifier);
|
||||
blue = int.Parse(hexColor.Substring(4, 2), NumberStyles.AllowHexSpecifier);
|
||||
}
|
||||
else if (hexColor.Length == 3)
|
||||
{
|
||||
//#RGB
|
||||
red = int.Parse(hexColor[0].ToString() + hexColor[0].ToString(), NumberStyles.AllowHexSpecifier);
|
||||
green = int.Parse(hexColor[1].ToString() + hexColor[1].ToString(), NumberStyles.AllowHexSpecifier);
|
||||
blue = int.Parse(hexColor[2].ToString() + hexColor[2].ToString(), NumberStyles.AllowHexSpecifier);
|
||||
}
|
||||
if (hexColor.Length == 6)
|
||||
{
|
||||
//#RRGGBB
|
||||
red = int.Parse(hexColor.Substring(0, 2), NumberStyles.AllowHexSpecifier);
|
||||
green = int.Parse(hexColor.Substring(2, 2), NumberStyles.AllowHexSpecifier);
|
||||
blue = int.Parse(hexColor.Substring(4, 2), NumberStyles.AllowHexSpecifier);
|
||||
}
|
||||
else if (hexColor.Length == 3)
|
||||
{
|
||||
//#RGB
|
||||
red = int.Parse(hexColor[0].ToString() + hexColor[0].ToString(), NumberStyles.AllowHexSpecifier);
|
||||
green = int.Parse(hexColor[1].ToString() + hexColor[1].ToString(), NumberStyles.AllowHexSpecifier);
|
||||
blue = int.Parse(hexColor[2].ToString() + hexColor[2].ToString(), NumberStyles.AllowHexSpecifier);
|
||||
}
|
||||
|
||||
Color returnColor = new Color(red, green, blue);
|
||||
return returnColor;
|
||||
Color returnColor = new Color(red, green, blue);
|
||||
return returnColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using GTANetworkAPI;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using System.Linq;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
class DatabaseHelper
|
||||
internal class DatabaseHelper
|
||||
{
|
||||
public static void InitDatabaseFirstTime()
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ using ReallifeGamemode.Server.Managers;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
class FactionHelper
|
||||
internal class FactionHelper
|
||||
{
|
||||
public static void CheckFactionBankAccounts()
|
||||
{
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
class FactionRankHelper
|
||||
internal class FactionRankHelper
|
||||
{
|
||||
public string FactionName { get; set; }
|
||||
public int FactionId { get; set; }
|
||||
public List<Rank> Ranks { get; set; }
|
||||
}
|
||||
|
||||
class Rank
|
||||
internal class Rank
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public static class GlobalHelper
|
||||
{
|
||||
public static List<Player> DutyAdmins = new List<Player>();
|
||||
public static List<Player> tsupAdmins = new List<Player>();
|
||||
{
|
||||
public static List<Player> DutyAdmins = new List<Player>();
|
||||
public static List<Player> tsupAdmins = new List<Player>();
|
||||
|
||||
public static Dictionary<string, string> CustomJoinMessages = new Dictionary<string, string>
|
||||
public static Dictionary<string, string> CustomJoinMessages = new Dictionary<string, string>
|
||||
{
|
||||
{ ".MichaPlays.", "Der Echte Ballas Leader ist online (MichaPlays)" },
|
||||
{ "balboistderbeste", "Hurra! Hurra! Der Balbo ist jetzt da! (balbo)" },
|
||||
{ "Roachkook", "Niemand, nicht einmal deine Mutter möchte so etwas sehen. (Siga)" },
|
||||
{ "Paaqo1337", "Picasso is back! (Paaqo)" }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public class IndicatorData
|
||||
{
|
||||
public bool Left { get; set; } = false;
|
||||
public bool Right { get; set; } = false;
|
||||
}
|
||||
}
|
||||
{
|
||||
public bool Left { get; set; } = false;
|
||||
public bool Right { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,38 +3,38 @@
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public class SmoothThrottleAntiReverse : Script
|
||||
{
|
||||
[ServerEvent(Event.PlayerExitVehicle)]
|
||||
public void SmoothThrottleExitEvent(Player player, Vehicle veh)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_PlayerExitVehicle", veh);
|
||||
}
|
||||
[ServerEvent(Event.PlayerExitVehicle)]
|
||||
public void SmoothThrottleExitEvent(Player player, Vehicle veh)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_PlayerExitVehicle", veh);
|
||||
}
|
||||
|
||||
[ServerEvent(Event.PlayerEnterVehicle)]
|
||||
public void SmoothThrottleEnterEvent(Player player, Vehicle veh, sbyte seat)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_PlayerEnterVehicle", veh, seat);
|
||||
}
|
||||
[ServerEvent(Event.PlayerEnterVehicle)]
|
||||
public void SmoothThrottleEnterEvent(Player player, Vehicle veh, sbyte seat)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_PlayerEnterVehicle", veh, seat);
|
||||
}
|
||||
|
||||
//You can call these to change settings on player if you want.
|
||||
//Note that these are toggles, you only need to call them once.
|
||||
//You can call these to change settings on player if you want.
|
||||
//Note that these are toggles, you only need to call them once.
|
||||
|
||||
//This disables/enables the smooth throttle
|
||||
public static void SetSmoothThrottle(Player player, bool turnedOn)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_SetSmoothThrottle", turnedOn);
|
||||
}
|
||||
//This disables/enables the smooth throttle
|
||||
public static void SetSmoothThrottle(Player player, bool turnedOn)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_SetSmoothThrottle", turnedOn);
|
||||
}
|
||||
|
||||
//This disables/enables anti reverse
|
||||
public static void SetAntiReverse(Player player, bool turnedOn)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_SetAntiReverse", turnedOn);
|
||||
}
|
||||
//This disables/enables anti reverse
|
||||
public static void SetAntiReverse(Player player, bool turnedOn)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_SetAntiReverse", turnedOn);
|
||||
}
|
||||
|
||||
//This disables/enables both
|
||||
public static void SetSmoothThrottleAntiReverse(Player player, bool turnedOn)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_SetGlobal", turnedOn);
|
||||
//This disables/enables both
|
||||
public static void SetSmoothThrottleAntiReverse(Player player, bool turnedOn)
|
||||
{
|
||||
NAPI.ClientEvent.TriggerClientEvent(player, "SmoothThrottle_SetGlobal", turnedOn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
using GTANetworkAPI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public class TaxiContract
|
||||
{
|
||||
public string Name { get; set; }
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public Vector3 Position { get; set; }
|
||||
public Vector3 Position { get; set; }
|
||||
|
||||
public Player Driver { get; set; }
|
||||
}
|
||||
public Player Driver { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,61 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Timers;
|
||||
using ReallifeGamemode.Server.Wanted;
|
||||
using System.Timers;
|
||||
using ReallifeGamemode.Server.Finance;
|
||||
using ReallifeGamemode.Server.WeaponDeal;
|
||||
using ReallifeGamemode.Server.Job;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Wanted;
|
||||
using ReallifeGamemode.Server.WeaponDeal;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public class ThreadTimers
|
||||
{
|
||||
|
||||
private static Timer timer500 = new Timer(500); //0.5 seconds timer
|
||||
private static Timer timer2500 = new Timer(2500); //2.5 seconds timer
|
||||
private static Timer timer10000 = new Timer(10000); // 10 second timer
|
||||
private static Timer timer60000 = new Timer(60000); //60 seconds timer
|
||||
|
||||
public static void StartAllTimers()
|
||||
{
|
||||
timer500.Start();
|
||||
timer500.Elapsed += Timer500_Elapsed;
|
||||
private static Timer timer500 = new Timer(500); //0.5 seconds timer
|
||||
private static Timer timer2500 = new Timer(2500); //2.5 seconds timer
|
||||
private static Timer timer10000 = new Timer(10000); // 10 second timer
|
||||
private static Timer timer60000 = new Timer(60000); //60 seconds timer
|
||||
|
||||
timer2500.Start();
|
||||
timer2500.Elapsed += Timer2500_Elapsed;
|
||||
public static void StartAllTimers()
|
||||
{
|
||||
timer500.Start();
|
||||
timer500.Elapsed += Timer500_Elapsed;
|
||||
|
||||
timer10000.Start();
|
||||
timer10000.Elapsed += Timer10000_Elapsed;
|
||||
timer2500.Start();
|
||||
timer2500.Elapsed += Timer2500_Elapsed;
|
||||
|
||||
timer60000.Start();
|
||||
timer60000.Elapsed += Timer60000_Elapsed;
|
||||
timer10000.Start();
|
||||
timer10000.Elapsed += Timer10000_Elapsed;
|
||||
|
||||
timer60000.Start();
|
||||
timer60000.Elapsed += Timer60000_Elapsed;
|
||||
}
|
||||
|
||||
private static void Timer500_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
TaxiDriverJob.UpdateFare();
|
||||
VehicleManager.VehicleTimerTick();
|
||||
}
|
||||
|
||||
private static void Timer60000_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
Jail.JailOut_Elapsed();
|
||||
Economy.Timer_Elapsed();
|
||||
WeaponDealManager.Timer_Elapsed();
|
||||
}
|
||||
|
||||
private static void Timer10000_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
Jail.BrakeOut_Elapsed();
|
||||
}
|
||||
|
||||
private static void Timer2500_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
WantedEscapeTimer.Timer_Elapsed();
|
||||
Jail.JailIn_Elapsed();
|
||||
Gangwar.Gangwar.Value_TimerElapsed();
|
||||
}
|
||||
}
|
||||
|
||||
private static void Timer500_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
TaxiDriverJob.UpdateFare();
|
||||
VehicleManager.VehicleTimerTick();
|
||||
}
|
||||
|
||||
private static void Timer60000_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
Jail.JailOut_Elapsed();
|
||||
Economy.Timer_Elapsed();
|
||||
WeaponDealManager.Timer_Elapsed();
|
||||
}
|
||||
|
||||
private static void Timer10000_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
Jail.BrakeOut_Elapsed();
|
||||
}
|
||||
|
||||
private static void Timer2500_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
WantedEscapeTimer.Timer_Elapsed();
|
||||
Jail.JailIn_Elapsed();
|
||||
Gangwar.Gangwar.Value_TimerElapsed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public enum TransactionResult
|
||||
{
|
||||
SUCCESS,
|
||||
SENDER_NO_BANKACCOUNT,
|
||||
RECEIVER_NO_BANKACCOUNT,
|
||||
SENDER_NOT_ENOUGH_MONEY,
|
||||
NEGATIVE_MONEY_SENT
|
||||
}
|
||||
{
|
||||
SUCCESS,
|
||||
SENDER_NO_BANKACCOUNT,
|
||||
RECEIVER_NO_BANKACCOUNT,
|
||||
SENDER_NOT_ENOUGH_MONEY,
|
||||
NEGATIVE_MONEY_SENT
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user