haus system auf core geändert
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user