#undef DEBUG
using System.Collections.Generic;
using System;
using System.Linq;
using RageCoop.Core;
using System.Windows.Forms;
using GTA;
namespace RageCoop.Client.Scripting
{
///
///
///
public class CustomEventReceivedArgs : EventArgs
{
///
/// The event hash
///
public int Hash { get; set; }
///
/// Supported types: byte, short, ushort, int, uint, long, ulong, float, bool, string, Vector3, Quaternion
///
public object[] Args { get; set; }
}
///
/// Provides vital functionality to interact with RAGECOOP
///
public static class API
{
#region INTERNAL
internal static Dictionary>> CustomEventHandlers = new Dictionary>>();
#endregion
///
/// Client configuration, this will conflict with server-side config.
///
public static class Config
{
///
/// Get or set local player's username, set won't be effective if already connected to a server.
///
public static string Username
{
get { return Main.Settings.Username; }
set
{
if (IsOnServer || string.IsNullOrEmpty(value))
{
return;
}
Main.Settings.Username = value;
}
}
///
/// Enable automatic respawn for this player.
///
public static bool EnableAutoRespawn { get; set; } = true;
///
/// Get or set player's blip color
///
public static BlipColor BlipColor { get; set; } = BlipColor.White;
///
/// Get or set player's blip sprite
///
public static BlipSprite BlipSprite { get; set; } = BlipSprite.Standard;
///
/// Get or set scale of player's blip
///
public static float BlipScale { get; set; } = 1;
}
///
/// Base events for RageCoop
///
public static class Events
{
#region DELEGATES
///
///
///
public delegate void EmptyEvent();
///
///
///
///
///
public delegate void CustomEvent(int hash, List