haus system auf core geändert

This commit is contained in:
hydrant
2020-03-29 12:18:17 +02:00
parent 6bd3d4a3d0
commit bcfc2105ea
68 changed files with 1366 additions and 810 deletions

View File

@@ -16,6 +16,8 @@ namespace ReallifeGamemode.Server.Core.RageMP
public ITextLabelAPI TextLabel => new RageTextLabelAPI();
public IBlipAPI Blip => new RageBlipAPI();
public void DisableDefaultCommandErrorMessages()
{
NAPI.Server.SetCommandErrorMessage(null);
@@ -61,5 +63,18 @@ namespace ReallifeGamemode.Server.Core.RageMP
{
NAPI.ClientEvent.TriggerClientEventForAll("SERVER:" + eventName, args);
}
public TEntity ToEntity<TEntity>(ushort handle) where TEntity : class, IEntity
{
return typeof(TEntity).Name switch
{
"IPlayer" => new RagePlayer(new NetHandle(handle, EntityType.Player).Entity<Player>()) as TEntity,
"IVehicle" => new RageVehicle(new NetHandle(handle, EntityType.Vehicle).Entity<Vehicle>()) as TEntity,
"IMarker" => new RageMarker(new NetHandle(handle, EntityType.Marker).Entity<Marker>()) as TEntity,
"ITextLabel" => new RageTextLabel(new NetHandle(handle, EntityType.TextLabel).Entity<TextLabel>()) as TEntity,
"IColShape" => new RageColShape(new NetHandle(handle, EntityType.Colshape).Entity<ColShape>()) as TEntity,
_ => null,
};
}
}
}