private bool roundstart = true;
private bool htmlstart = true;
private void StartLive()
{
RegisterEventHandler<EventRoundStart>((@event, info) =>
{
roundstart = true;
return HookResult.Continue;
});
RegisterEventHandler<EventRoundFreezeEnd>((@event, info) =>
{
htmlstart = false;
return HookResult.Continue;
});
RegisterListener<Listeners.OnTick>(() =>
{
if (roundstart)
{
roundstart = false;
htmlstart = true;
}
if (htmlstart)
{
for (int i = 1; i < Server.MaxPlayers; i++)
{
var ent = NativeAPI.GetEntityFromIndex(i);
if (ent == 0)
continue;
var client = new CCSPlayerController(ent);
if (client == null || !client.IsValid)
continue;
client.PrintToCenterHtml(
$"<img src='图片地址' alt='Image' /><br>"
);
}
}
});