From 8cd0e6199c3747ae983a8d8494e7e03dc3da7f3f Mon Sep 17 00:00:00 2001 From: KDani-99 Date: Thu, 16 Jul 2020 14:56:51 +0200 Subject: [PATCH] API v1.0.2 --- Source/Callout.cs | 4 ++-- Source/Events.cs | 7 +++++++ Source/Utilities.cs | 28 ++++++++++++++++++++++++++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/Source/Callout.cs b/Source/Callout.cs index 747434a..49ced93 100644 --- a/Source/Callout.cs +++ b/Source/Callout.cs @@ -97,7 +97,7 @@ protected async Task SpawnPed(PedHash pedHash, Vector3 location, float head Ped ped = (Ped)Entity.FromHandle(CreatePed(0, model, location.X, location.Y, location.Z, heading, true, true)); SetEntityAsMissionEntity(ped.Handle, true, true); - + return ped; } @@ -297,7 +297,7 @@ public virtual void OnCancelAfter() { } public delegate void ShowDialogDelegate(string text, int duration ,float showRadius); public ShowDialogDelegate ShowDialog { get; set; } - public delegate void ShowNotificationDelegate(string text, string textureDict, string textureName, string sender, string subject, float showRadius); + public delegate void ShowNotificationDelegate(string text, string textureDict, string textureName, string sender, string subject, float showRadius,int bgColor = -1); public ShowNotificationDelegate ShowNetworkedNotification { get; set; } public delegate void UpdateDataDelegate(string location = null); diff --git a/Source/Events.cs b/Source/Events.cs index 67d5763..d623f90 100644 --- a/Source/Events.cs +++ b/Source/Events.cs @@ -16,6 +16,9 @@ public abstract class Events public delegate Task OnServiceCalledDelegate(Utilities.Services service); public static event OnServiceCalledDelegate OnServiceCalled; + public delegate Task OnServiceCancelledDelegate(Utilities.Services service); + public static event OnServiceCancelledDelegate OnServiceCancelled; + public delegate Task OnCalloutReceivedDelegate(Callout callout); public static event OnCalloutReceivedDelegate OnCalloutReceived; @@ -33,6 +36,10 @@ public static void InvokeServiceEvent(Utilities.Services service) { OnServiceCalled?.Invoke(service); } + public static void InvokeServiceCancelledEvent(Utilities.Services service) + { + OnServiceCancelled?.Invoke(service); + } public static void InvokeCalloutReceivedEvent(Callout callout) { OnCalloutReceived?.Invoke(callout); diff --git a/Source/Utilities.cs b/Source/Utilities.cs index fb38ffa..18c489c 100644 --- a/Source/Utilities.cs +++ b/Source/Utilities.cs @@ -42,7 +42,7 @@ public enum Services public delegate Task GetVehicleDataDelegate(int networkID); public static GetVehicleDataDelegate GetVehicleData; - public delegate void SetVehicleDataDelegate(int vehicle, ExpandoObject data); + public delegate void SetVehicleDataDelegate(int vehicle,ExpandoObject data); public static SetVehicleDataDelegate SetVehicleData; public delegate void ExcludeVehicleFromTrafficStopDelegate(int networkID, bool exclude); @@ -60,6 +60,30 @@ public enum Services /// Cancels the last requested service (by service type). /// public static CancelServiceDelegate CancelService; + + #endregion + + #region Traffic Stop + public delegate Task IsPlayerPerformingTrafficStopDelegate(); + public static IsPlayerPerformingTrafficStopDelegate IsPlayerPerformingTrafficStop; + + public delegate Task GetVehicleFromTrafficStopDelegate(); + public static GetVehicleFromTrafficStopDelegate GetVehicleFromTrafficStop; + #endregion + + #region Backups + public enum Backups + { + Code1 = 1, + Code2 = 2, + Code3 = 3, + Code99 = 99 + } + public delegate void RequestBackupDelegate(Backups backup); + public static RequestBackupDelegate RequestBackup; + + public delegate void CancelBackupDelegate(); + public static CancelBackupDelegate CancelBackup; #endregion #region Ped @@ -165,4 +189,4 @@ public static Ped GetClosestPed(Ped p) public static Func GetRandomPosInPlayerDepartmentArea; #endregion } -} \ No newline at end of file +}