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

@ -12,13 +12,21 @@ namespace RageCoop.Server.Scripting
public override void OnStart()
{
API.RegisterCustomEventHandler(CustomEvents.NativeResponse, NativeResponse);
API.RegisterCustomEventHandler(CustomEvents.OnVehicleDeleted, (e) =>
{
API.Entities.RemoveVehicle((int)e.Args[0]);
});
API.RegisterCustomEventHandler(CustomEvents.OnPedDeleted, (e) =>
{
API.Entities.RemovePed((int)e.Args[0]);
});
}
public override void OnStop()
{
}
public void SetAutoRespawn(Client c,bool toggle)
{
c.SendCustomEvent(CustomEvents.SetAutoRespawn, new() { toggle });
c.SendCustomEvent(CustomEvents.SetAutoRespawn, toggle );
}
void NativeResponse(CustomEventReceivedArgs e)
{