@@ -13,6 +13,8 @@ namespace Exiled.API.Features
1313 using System . Collections . ObjectModel ;
1414 using System . Linq ;
1515
16+ using CommandSystem . Commands . RemoteAdmin . Cleanup ;
17+ using Decals ;
1618 using Enums ;
1719 using Exiled . API . Extensions ;
1820 using Exiled . API . Features . Hazards ;
@@ -27,6 +29,7 @@ namespace Exiled.API.Features
2729 using PlayerRoles . Ragdolls ;
2830 using UnityEngine ;
2931 using Utils ;
32+ using Utils . Networking ;
3033
3134 using Object = UnityEngine . Object ;
3235
@@ -130,6 +133,17 @@ public static void Broadcast(ushort duration, string message, global::Broadcast.
130133 Server . Broadcast . RpcAddElement ( message , duration , type ) ;
131134 }
132135
136+ /// <summary>
137+ /// Broadcasts delegate invocation result to all <see cref="Player">players</see>.
138+ /// </summary>
139+ /// <param name="duration">The duration in seconds.</param>
140+ /// <param name="func">The delegate whose invocation result will be the message.</param>
141+ public static void Broadcast ( ushort duration , Func < Player , string > func )
142+ {
143+ foreach ( Player player in Player . List )
144+ player . Broadcast ( duration , func . Invoke ( player ) ) ;
145+ }
146+
133147 /// <summary>
134148 /// Shows a hint to all <see cref="Player">players</see>.
135149 /// </summary>
@@ -271,6 +285,19 @@ public static void CleanAllRagdolls(IEnumerable<Ragdoll> ragDolls)
271285 ragDoll . Destroy ( ) ;
272286 }
273287
288+ /// <summary>
289+ /// Destroy specified amount of specified <see cref="DecalPoolType"/> object.
290+ /// </summary>
291+ /// <param name="decalType">Decal type to destroy.</param>
292+ /// <param name="amount">Amount of decals to destroy.</param>
293+ public static void Clean ( DecalPoolType decalType , int amount ) => new DecalCleanupMessage ( decalType , amount ) . SendToAuthenticated ( ) ;
294+
295+ /// <summary>
296+ /// Destroy all specified <see cref="DecalPoolType"/> objects.
297+ /// </summary>
298+ /// <param name="decalType">Decal type to destroy.</param>
299+ public static void Clean ( DecalPoolType decalType ) => Clean ( decalType , int . MaxValue ) ;
300+
274301 /// <summary>
275302 /// Places a blood decal.
276303 /// </summary>
0 commit comments