Иконка ресурса

FREE PlayerDisconnectCommand : 1.0.2 1.0.2

Нет прав для скачивания
C#:
// Все права принадлежат дискорд сообществу https://discord.gg/VgNHPpNrz6
using System;
using Oxide.Core.Plugins;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("PlayerDisconnectCommand", "YourName", "1.0.2")]
    [Description("Executes a console command when a player disconnects")]
    public class PlayerDisconnectCommand : RustPlugin
    {
        private void OnPlayerDisconnected(BasePlayer player, string reason)
        {
            // اجرای دستور با تاخیر برای جلوگیری از خطای تغییر مجموعه در حین شمارش
            timer.Once(0.1f, () => {
                Puts("Executing command: server.secure 0");
                ExecuteConsoleCommand("server.secure 0");
            });
        }

        private void ExecuteConsoleCommand(string command)
        {
            ConsoleSystem.Run(ConsoleSystem.Option.Server.Quiet(), command);
        }
    }
}

Автор
15FPS
Скачиваний
0
Просмотры
1
Первый выпуск
Обновление
Оценка
0.00 звёзд 0 оценок
Сверху