2022-03-25 19:53:48 +01:00
|
|
|
|
using System;
|
2022-03-25 20:09:45 +01:00
|
|
|
|
using System.IO;
|
2022-03-31 18:03:19 +02:00
|
|
|
|
using System.Linq;
|
2022-03-25 20:09:45 +01:00
|
|
|
|
using System.Collections.Generic;
|
2022-03-25 19:53:48 +01:00
|
|
|
|
|
|
|
|
|
using Microsoft.ClearScript.V8;
|
|
|
|
|
|
|
|
|
|
using GTA;
|
2022-03-31 18:03:19 +02:00
|
|
|
|
using GTA.Native;
|
2022-04-02 16:14:42 +02:00
|
|
|
|
using GTA.Math;
|
2022-03-25 19:53:48 +01:00
|
|
|
|
|
|
|
|
|
namespace CoopClient
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Don't use this!
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class JavascriptHook : Script
|
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
private static readonly List<V8ScriptEngine> _scriptEngines = new List<V8ScriptEngine>();
|
2022-04-06 05:54:03 +02:00
|
|
|
|
internal static bool JavascriptLoaded { get; private set; } = false;
|
2022-03-25 19:53:48 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Don't use this!
|
|
|
|
|
/// </summary>
|
|
|
|
|
public JavascriptHook()
|
|
|
|
|
{
|
|
|
|
|
Tick += Ontick;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Ontick(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
if (!Main.MainNetworking.IsOnServer() || _scriptEngines.Count == 0)
|
2022-03-25 19:53:48 +01:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-10 14:34:55 +02:00
|
|
|
|
lock (_scriptEngines)
|
2022-03-25 19:53:48 +01:00
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
_scriptEngines.ForEach(engine => engine.Script.API.InvokeTick());
|
2022-03-25 21:51:29 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-25 20:09:45 +01:00
|
|
|
|
|
2022-03-25 21:51:29 +01:00
|
|
|
|
internal static void LoadAll()
|
|
|
|
|
{
|
|
|
|
|
string serverAddress = Main.MainSettings.LastServerAddress.Replace(":", ".");
|
2022-03-25 21:07:07 +01:00
|
|
|
|
|
2022-03-25 21:51:29 +01:00
|
|
|
|
if (!Directory.Exists("scripts\\resources\\" + serverAddress))
|
|
|
|
|
{
|
|
|
|
|
try
|
2022-03-25 20:09:45 +01:00
|
|
|
|
{
|
2022-03-25 21:51:29 +01:00
|
|
|
|
Directory.CreateDirectory("scripts\\resources\\" + serverAddress);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2022-03-29 00:28:57 +02:00
|
|
|
|
GTA.UI.Notification.Show("~r~~h~Javascript Error");
|
2022-03-28 23:59:19 +02:00
|
|
|
|
Logger.Write(ex.Message, Logger.LogLevel.Server);
|
2022-03-29 00:28:57 +02:00
|
|
|
|
|
|
|
|
|
// Without the directory we can't do the other stuff
|
|
|
|
|
return;
|
2022-03-25 20:09:45 +01:00
|
|
|
|
}
|
2022-03-25 21:51:29 +01:00
|
|
|
|
}
|
2022-03-25 20:30:03 +01:00
|
|
|
|
|
2022-04-10 14:34:55 +02:00
|
|
|
|
lock (_scriptEngines)
|
2022-03-25 21:51:29 +01:00
|
|
|
|
{
|
2022-03-25 21:07:07 +01:00
|
|
|
|
foreach (string script in Directory.GetFiles("scripts\\resources\\" + serverAddress, "*.js"))
|
2022-03-25 20:09:45 +01:00
|
|
|
|
{
|
2022-04-06 12:13:39 +02:00
|
|
|
|
V8ScriptEngine engine = new V8ScriptEngine()
|
|
|
|
|
{
|
|
|
|
|
AccessContext = typeof(ScriptContext)
|
|
|
|
|
};
|
2022-03-25 20:09:45 +01:00
|
|
|
|
|
2022-03-31 17:31:39 +02:00
|
|
|
|
engine.AddHostObject("API", new ScriptContext());
|
2022-03-25 20:09:45 +01:00
|
|
|
|
|
2022-04-06 12:13:39 +02:00
|
|
|
|
engine.AddHostType(typeof(Dictionary<,>));
|
2022-04-02 16:14:42 +02:00
|
|
|
|
|
2022-04-06 12:13:39 +02:00
|
|
|
|
// SHVDN
|
|
|
|
|
engine.AddHostType(typeof(Vector3));
|
|
|
|
|
engine.AddHostType(typeof(Quaternion));
|
2022-04-02 16:14:42 +02:00
|
|
|
|
|
2022-03-25 20:30:03 +01:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
engine.Execute(File.ReadAllText(script));
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2022-03-29 00:28:57 +02:00
|
|
|
|
GTA.UI.Notification.Show("~r~~h~Javascript Error");
|
2022-03-28 23:59:19 +02:00
|
|
|
|
Logger.Write(ex.Message, Logger.LogLevel.Server);
|
2022-03-25 20:30:03 +01:00
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
2022-03-25 21:51:29 +01:00
|
|
|
|
engine.Script.API.InvokeStart();
|
2022-04-10 14:34:55 +02:00
|
|
|
|
_scriptEngines.Add(engine);
|
2022-03-25 20:30:03 +01:00
|
|
|
|
}
|
2022-03-25 20:09:45 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-06 05:54:03 +02:00
|
|
|
|
|
|
|
|
|
JavascriptLoaded = true;
|
2022-03-25 21:51:29 +01:00
|
|
|
|
}
|
2022-03-25 20:09:45 +01:00
|
|
|
|
|
2022-03-25 21:51:29 +01:00
|
|
|
|
internal static void StopAll()
|
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
lock (_scriptEngines)
|
2022-03-25 21:51:29 +01:00
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
_scriptEngines.ForEach(engine =>
|
2022-04-06 05:54:03 +02:00
|
|
|
|
{
|
|
|
|
|
engine.Script.API.InvokeStop();
|
|
|
|
|
engine.Dispose();
|
|
|
|
|
});
|
2022-04-10 14:34:55 +02:00
|
|
|
|
_scriptEngines.Clear();
|
2022-03-25 21:51:29 +01:00
|
|
|
|
}
|
2022-04-06 05:54:03 +02:00
|
|
|
|
|
|
|
|
|
JavascriptLoaded = false;
|
2022-03-25 19:53:48 +01:00
|
|
|
|
}
|
2022-03-26 17:50:34 +01:00
|
|
|
|
|
|
|
|
|
internal static void InvokePlayerConnect(string username, long nethandle)
|
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
lock (_scriptEngines)
|
2022-03-26 17:50:34 +01:00
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
_scriptEngines.ForEach(engine => engine.Script.API.InvokePlayerConnect(username, nethandle));
|
2022-03-26 17:50:34 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal static void InvokePlayerDisonnect(string username, long nethandle, string reason = null)
|
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
lock (_scriptEngines)
|
2022-03-26 17:50:34 +01:00
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
_scriptEngines.ForEach(engine => engine.Script.API.InvokePlayerDisonnect(username, nethandle, reason));
|
2022-03-26 17:50:34 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal static void InvokeChatMessage(string from, string message)
|
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
lock (_scriptEngines)
|
2022-03-26 17:50:34 +01:00
|
|
|
|
{
|
2022-04-10 14:34:55 +02:00
|
|
|
|
_scriptEngines.ForEach(engine => engine.Script.API.InvokeChatMessage(from, message));
|
2022-03-26 17:50:34 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-25 19:53:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-03-27 19:49:23 +02:00
|
|
|
|
internal class ScriptContext
|
2022-03-25 19:53:48 +01:00
|
|
|
|
{
|
2022-03-27 19:49:23 +02:00
|
|
|
|
#region DELEGATES
|
2022-03-30 16:14:25 +02:00
|
|
|
|
public delegate void EmptyEvent();
|
2022-03-26 17:50:34 +01:00
|
|
|
|
public delegate void PlayerConnectEvent(string username, long nethandle, string reason);
|
|
|
|
|
public delegate void ChatMessageEvent(string from, string message);
|
2022-03-27 19:49:23 +02:00
|
|
|
|
#endregion
|
2022-03-26 17:50:34 +01:00
|
|
|
|
|
2022-03-27 19:49:23 +02:00
|
|
|
|
#region EVENTS
|
2022-03-30 16:14:25 +02:00
|
|
|
|
public event EmptyEvent OnStart, OnStop, OnTick;
|
2022-03-26 17:50:34 +01:00
|
|
|
|
public event PlayerConnectEvent OnPlayerConnect, OnPlayerDisconnect;
|
|
|
|
|
public event ChatMessageEvent OnChatMessage;
|
2022-03-25 20:30:03 +01:00
|
|
|
|
|
2022-03-25 21:51:29 +01:00
|
|
|
|
internal void InvokeStart()
|
2022-03-25 20:30:03 +01:00
|
|
|
|
{
|
2022-03-30 16:14:25 +02:00
|
|
|
|
OnStart?.Invoke();
|
2022-03-25 20:30:03 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-03-25 21:51:29 +01:00
|
|
|
|
internal void InvokeStop()
|
2022-03-25 20:30:03 +01:00
|
|
|
|
{
|
2022-03-30 16:14:25 +02:00
|
|
|
|
OnStop?.Invoke();
|
2022-03-25 21:51:29 +01:00
|
|
|
|
}
|
2022-03-25 20:30:03 +01:00
|
|
|
|
|
2022-03-25 21:51:29 +01:00
|
|
|
|
internal void InvokeTick()
|
|
|
|
|
{
|
2022-03-30 16:14:25 +02:00
|
|
|
|
OnTick?.Invoke();
|
2022-03-25 20:30:03 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-03-26 17:50:34 +01:00
|
|
|
|
internal void InvokePlayerConnect(string username, long nethandle)
|
|
|
|
|
{
|
|
|
|
|
OnPlayerConnect?.Invoke(username, nethandle, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void InvokePlayerDisonnect(string username, long nethandle, string reason)
|
|
|
|
|
{
|
|
|
|
|
OnPlayerDisconnect?.Invoke(username, nethandle, reason);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void InvokeChatMessage(string from, string message)
|
|
|
|
|
{
|
|
|
|
|
OnChatMessage?.Invoke(from, message);
|
|
|
|
|
}
|
2022-03-27 19:49:23 +02:00
|
|
|
|
#endregion
|
2022-03-26 17:50:34 +01:00
|
|
|
|
|
2022-03-31 18:03:19 +02:00
|
|
|
|
/* ===== PLAYER STUFF ===== */
|
2022-03-25 21:51:29 +01:00
|
|
|
|
public void SendLocalMessage(string message)
|
2022-03-25 19:53:48 +01:00
|
|
|
|
{
|
|
|
|
|
Main.MainChat.AddMessage("JAVASCRIPT", message);
|
|
|
|
|
}
|
2022-03-28 16:43:52 +02:00
|
|
|
|
|
|
|
|
|
public string GetLocalUsername()
|
|
|
|
|
{
|
|
|
|
|
return Main.MainSettings.Username;
|
|
|
|
|
}
|
2022-03-30 16:14:25 +02:00
|
|
|
|
|
|
|
|
|
public long GetLocalNetHandle()
|
|
|
|
|
{
|
|
|
|
|
return Main.LocalNetHandle;
|
|
|
|
|
}
|
2022-03-31 18:03:19 +02:00
|
|
|
|
|
|
|
|
|
// This only applies to server-side created objects
|
|
|
|
|
public void CleanUpWorld()
|
|
|
|
|
{
|
|
|
|
|
Main.CleanUpWorld();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This create an object to delete it with CleanUpWorld() or on disconnect
|
|
|
|
|
public void CreateObject(string hash, params object[] args)
|
|
|
|
|
{
|
|
|
|
|
if (!Hash.TryParse(hash, out Hash ourHash) || !Main.CheckNativeHash.ContainsKey((ulong)ourHash))
|
|
|
|
|
{
|
|
|
|
|
GTA.UI.Notification.Show("~r~~h~Javascript Error");
|
|
|
|
|
Logger.Write($"Hash \"{ourHash}\" has not been found!", Logger.LogLevel.Server);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int result = Function.Call<int>(ourHash, args.Select(o => new InputArgument(o)).ToArray());
|
|
|
|
|
|
|
|
|
|
foreach (KeyValuePair<ulong, byte> checkHash in Main.CheckNativeHash)
|
|
|
|
|
{
|
|
|
|
|
if (checkHash.Key == (ulong)ourHash)
|
|
|
|
|
{
|
|
|
|
|
lock (Main.ServerItems)
|
|
|
|
|
{
|
|
|
|
|
Main.ServerItems.Add(result, checkHash.Value);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-02 16:14:42 +02:00
|
|
|
|
|
|
|
|
|
public void SendNotification(string message)
|
|
|
|
|
{
|
|
|
|
|
GTA.UI.Notification.Show(message);
|
|
|
|
|
}
|
|
|
|
|
public void SendNotification(string[] messages)
|
|
|
|
|
{
|
|
|
|
|
SendNotification(string.Concat(messages));
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 12:13:39 +02:00
|
|
|
|
public bool IsPlayerInvincible()
|
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character.IsInvincible;
|
|
|
|
|
}
|
|
|
|
|
public void SetPlayerInvincible(bool invincible)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.IsInvincible = invincible;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-02 16:14:42 +02:00
|
|
|
|
public Vector3 GetPlayerPosition()
|
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character.Position;
|
|
|
|
|
}
|
|
|
|
|
public Vector3 GetPlayerRotation()
|
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character.Rotation;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 12:13:39 +02:00
|
|
|
|
public void SetPlayerPosition(Vector3 position)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.Position = position;
|
|
|
|
|
}
|
|
|
|
|
public void SetPlayerPositionNoOffset(Vector3 position)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.PositionNoOffset = position;
|
|
|
|
|
}
|
|
|
|
|
public void SetPlayerRotation(Vector3 rotation)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.Rotation = rotation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsPlayerInAnyVehicle()
|
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character.IsInVehicle();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int GetCharachterHandle()
|
2022-04-02 16:14:42 +02:00
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character?.Handle ?? 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 12:13:39 +02:00
|
|
|
|
public Vector3? GetVehiclePosition()
|
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character.CurrentVehicle?.Position;
|
|
|
|
|
}
|
|
|
|
|
public Vector3? GetVehicleRotation()
|
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character.CurrentVehicle?.Rotation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetVehiclePosition(Vector3 position)
|
|
|
|
|
{
|
|
|
|
|
if (Game.Player.Character.IsInVehicle())
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.CurrentVehicle.Position = position;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public void SetVehiclePositionNoOffset(Vector3 position)
|
|
|
|
|
{
|
|
|
|
|
if (Game.Player.Character.IsInVehicle())
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.CurrentVehicle.PositionNoOffset = position;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public void SetVehicleRotation(Vector3 rotation)
|
|
|
|
|
{
|
|
|
|
|
if (Game.Player.Character.IsInVehicle())
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.CurrentVehicle.Rotation = rotation;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int GetVehicleHandle()
|
2022-04-02 16:14:42 +02:00
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character?.CurrentVehicle?.Handle ?? 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 12:13:39 +02:00
|
|
|
|
public int GetVehicleSeatIndex()
|
2022-04-02 16:14:42 +02:00
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character?.CurrentVehicle != null ? (int)Game.Player.Character?.SeatIndex : 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 12:13:39 +02:00
|
|
|
|
public void SetVehicleEngineStatus(bool turnedOn)
|
|
|
|
|
{
|
|
|
|
|
if (Game.Player.Character.IsInVehicle())
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.CurrentVehicle.IsEngineRunning = turnedOn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public bool GetVehicleEngineStatus()
|
|
|
|
|
{
|
|
|
|
|
return Game.Player.Character.IsInVehicle() ? Game.Player.Character.CurrentVehicle.IsEngineRunning : false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RepairVehicle()
|
|
|
|
|
{
|
|
|
|
|
if (Game.Player.Character.IsInVehicle())
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.CurrentVehicle.Repair();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void GivePlayerWeapon(uint hash, int ammoCount, bool equipNow, bool isAmmoLoaded)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.Weapons.Give((WeaponHash)hash, ammoCount, equipNow, isAmmoLoaded);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetPlayerHealth(int health)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.Health = health;
|
|
|
|
|
}
|
|
|
|
|
public void SetPlayerHealth(float health)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.HealthFloat = health;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetPlayerArmor(int armor)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.Armor = armor;
|
|
|
|
|
}
|
|
|
|
|
public void SetPlayerArmor(float armor)
|
|
|
|
|
{
|
|
|
|
|
Game.Player.Character.ArmorFloat = armor;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-02 16:14:42 +02:00
|
|
|
|
/* ===== OTHER PLAYER STUFF ===== */
|
|
|
|
|
public Vector3 GetPlayerPosition(long nethandle)
|
|
|
|
|
{
|
|
|
|
|
lock (Main.Players)
|
|
|
|
|
{
|
|
|
|
|
return Main.Players.ContainsKey(nethandle) ? Main.Players.First(x => x.Key == nethandle).Value.Position : default;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public Vector3 GetPlayerRotation(long nethandle)
|
|
|
|
|
{
|
|
|
|
|
lock (Main.Players)
|
|
|
|
|
{
|
|
|
|
|
return Main.Players.ContainsKey(nethandle) ? Main.Players.First(x => x.Key == nethandle).Value.Rotation : default;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get nethandle and charachter handle
|
|
|
|
|
public Dictionary<long, int> GetAllNearbyPlayers(float distance)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<long, int> result = new Dictionary<long, int>();
|
|
|
|
|
|
|
|
|
|
lock (Main.Players)
|
|
|
|
|
{
|
|
|
|
|
Vector3 localPosition = Game.Player.Character.Position;
|
|
|
|
|
foreach (KeyValuePair<long, Entities.Player.EntitiesPlayer> player in Main.Players)
|
|
|
|
|
{
|
|
|
|
|
if (player.Value.Position.DistanceTo2D(localPosition) < distance)
|
|
|
|
|
{
|
|
|
|
|
// Character handle = 0 (if no character exists)
|
|
|
|
|
result.Add(player.Key, player.Value.Character?.Handle ?? 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public long GetNetHandleByUsername(string username)
|
|
|
|
|
{
|
|
|
|
|
lock (Main.Players)
|
|
|
|
|
{
|
|
|
|
|
return Main.Players.FirstOrDefault(x => x.Value.Username == username).Key;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-06 12:13:39 +02:00
|
|
|
|
|
|
|
|
|
/* ===== OTHER STUFF ===== */
|
|
|
|
|
public bool IsControlJustReleased(int control)
|
|
|
|
|
{
|
|
|
|
|
return Game.IsControlJustReleased((Control)control);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsControlJustPressed(int control)
|
|
|
|
|
{
|
|
|
|
|
return Game.IsControlJustPressed((Control)control);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsControlPressed(int control)
|
|
|
|
|
{
|
|
|
|
|
return Game.IsControlPressed((Control)control);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void TriggerServerEvent(string eventName, params object[] args)
|
|
|
|
|
{
|
|
|
|
|
// TODO
|
|
|
|
|
}
|
2022-03-25 19:53:48 +01:00
|
|
|
|
}
|
|
|
|
|
}
|