added aduty system + added ChatService.BroadcastDutyAdmin + fixes in report system + added paaqos busdriver job
This commit is contained in:
76
ReallifeGamemode.Client/Jobs/BusDriver/Main.cs
Normal file
76
ReallifeGamemode.Client/Jobs/BusDriver/Main.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using RAGE;
|
||||
|
||||
|
||||
namespace ReallifeGamemode.Client.Jobs.BusDriver
|
||||
{
|
||||
public class Main : Events.Script
|
||||
{
|
||||
public static CheckpointInstance NextObjective { get; set; } = null;
|
||||
|
||||
public static int tick = 0;
|
||||
public static int around_one_sec = 80;
|
||||
|
||||
public static bool check_for_key_press = true;
|
||||
|
||||
public Main()
|
||||
{
|
||||
Chat.Output("Loaded Clientside");
|
||||
Events.Add("load_objective", LoadObjective);
|
||||
Events.Add("clear_all_markers", ClearJobCheckPoints);
|
||||
Events.Tick += OnUpdate;
|
||||
}
|
||||
|
||||
private void OnUpdate(List<Events.TickNametagData> nametags)
|
||||
{
|
||||
tick++;
|
||||
|
||||
if (tick >= around_one_sec)
|
||||
{
|
||||
HeartBeat();
|
||||
}
|
||||
}
|
||||
|
||||
public void HeartBeat()
|
||||
{
|
||||
tick = 0;
|
||||
check_for_key_press = true;
|
||||
|
||||
|
||||
if (NextObjective != null)
|
||||
{
|
||||
CheckpointInstance checkpointInstance = CheckpointHelper.IsNearCheckpoint(3f);
|
||||
|
||||
if (checkpointInstance != null)
|
||||
{
|
||||
NextObjective = null;
|
||||
CheckpointHelper.ClearCheckpoint(checkpointInstance);
|
||||
Events.CallRemote("marker_completed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearJobCheckPoints(object[] args)
|
||||
{
|
||||
CheckpointHelper.ClearAllCheckpoints();
|
||||
}
|
||||
|
||||
public static void LoadObjective(object[] args)
|
||||
{
|
||||
Vector3 markerPosition = (Vector3)args[0];
|
||||
float markerSize = Convert.ToSingle(args[1]);
|
||||
|
||||
if (markerPosition == null)
|
||||
return;
|
||||
|
||||
if (NextObjective != null)
|
||||
{
|
||||
CheckpointHelper.ClearCheckpoint(NextObjective);
|
||||
}
|
||||
|
||||
NextObjective = new CheckpointInstance(markerPosition, markerSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user