Skip to content

Commit

Permalink
API v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
KDani-99 committed Jul 16, 2020
1 parent 62079b4 commit 8cd0e61
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/Callout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected async Task<Ped> 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;
}

Expand Down Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions Source/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down
28 changes: 26 additions & 2 deletions Source/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public enum Services
public delegate Task<ExpandoObject> 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);
Expand All @@ -60,6 +60,30 @@ public enum Services
/// Cancels the last requested service (by service type).
/// </summary>
public static CancelServiceDelegate CancelService;

#endregion

#region Traffic Stop
public delegate Task<bool> IsPlayerPerformingTrafficStopDelegate();
public static IsPlayerPerformingTrafficStopDelegate IsPlayerPerformingTrafficStop;

public delegate Task<Vehicle> 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
Expand Down Expand Up @@ -165,4 +189,4 @@ public static Ped GetClosestPed(Ped p)
public static Func<Vector3> GetRandomPosInPlayerDepartmentArea;
#endregion
}
}
}

0 comments on commit 8cd0e61

Please sign in to comment.