C#:
using System.Linq;
using System.Collections.Generic;
namespace Oxide.Plugins
{
[Info("Photofix", "Death", "1.0.3")]
class Photofix : RustPlugin
{
void OnServerInitialized()
{
var photoEntityList = Facepunch.Pool.Get<List<PhotoEntity>>();
photoEntityList.AddRange(BaseNetworkable.serverEntities.OfType<PhotoEntity>());
foreach (var photoEntity in photoEntityList)
{
var imageData = FileStorage.server.Get(photoEntity.ImageCrc, FileStorage.Type.jpg, photoEntity.net.ID, 0);
if (imageData == null)
{
Puts($"Image data is null for {photoEntity.net.ID}. Destroying...");
photoEntity.Kill();
}
}
Facepunch.Pool.FreeUnmanaged(ref photoEntityList);
}
}
}