Server side entities and custom resource location

This commit is contained in:
Sardelka
2022-07-01 19:02:38 +08:00
parent 77999fe8f3
commit eb5b23ae17
15 changed files with 325 additions and 127 deletions

View File

@ -5,6 +5,7 @@ using GTA.Native;
using RageCoop.Core;
using System.Collections.Generic;
using System.Linq;
using RageCoop.Client.Scripting;
using System.Text;
using System.Diagnostics;
using System.Threading.Tasks;
@ -138,6 +139,10 @@ namespace RageCoop.Client
{
Handle_Peds.Add(c.MainPed.Handle, c);
}
if (c.IsMine)
{
API.Events.InvokePedSpawned(c);
}
}
public static void RemovePed(int id,string reason="Cleanup")
{
@ -160,6 +165,10 @@ namespace RageCoop.Client
c.PedBlip?.Delete();
c.ParachuteProp?.Delete();
ID_Peds.Remove(id);
if (c.IsMine)
{
API.Events.InvokePedDeleted(c);
}
}
}
#endregion
@ -196,6 +205,10 @@ namespace RageCoop.Client
{
Handle_Vehicles.Add(v.MainVehicle.Handle, v);
}
if (v.IsMine)
{
API.Events.InvokeVehicleSpawned(v);
}
}
public static void RemoveVehicle(int id,string reason = "Cleanup")
{
@ -215,6 +228,7 @@ namespace RageCoop.Client
veh.Delete();
}
ID_Vehicles.Remove(id);
if (v.IsMine) { API.Events.InvokeVehicleDeleted(v); }
}
}