using System;
using Oxide.Core;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("SpeedRecorder", "YourName", "1.0.0")]
class SpeedRecorder : RustPlugin
{
private void OnPlayerTick(BasePlayer player)
{
if (player == null || player.IsSleeping())
return;
float playerSpeed = player.GetParentEntity().GetEstimatedSpeed();
float maxSpeed = 5.0f; // Максимальная допустимая скорость
if (playerSpeed > maxSpeed)
{
// Запись демки или другие действия по вашему усмотрению
Puts($"{player.displayName} exceeded the speed limit. Speed: {playerSpeed}");
}
}
void OnServerInitialized()
{
timer.Every(1f, () =>
{
foreach (BasePlayer player in BasePlayer.activePlayerList)
{
OnPlayerTick(player);
}
});
}
}
}