Key press detection and logging (Rust)Solved
Hello , basicly i need simple plugin "Detect" When Player will press specific Key's plugin will log warning with nickname id and pressed key plus will send message to admins online.

Ready to Pay 10 $ for Working Plugin.

Example of Keys pressed by player.

private List<string> keyName = new List<string> { "Home", "F12", "Delete", "Insert", "End","0","[","]","х","ъ","rightarrow" };​

Example of NON WORKING PLUGIN

using System.Collections.Generic;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("InputKeyDetect", "unknow", "1.0.0")]
    public class InputKeyDetect : RustPlugin
    {
        private List<string> keyName = new List<string> { "Home", "Delete", "Insert", "End","0","[","]","х","ъ","rightarrow" };
        
        private string Permission = "InputKeyDetect.allowed";

        private void Init() => permission.RegisterPermission(Permission, this);
        
        private void OnServerInitialized()
        {
            foreach (var player in BasePlayer.activePlayerList)
                OnPlayerInit(player);
        }
        
        private void OnPlayerInit(BasePlayer player)
        {
            for (int i = 0; i < keyName.Count; i++)
                player.SendConsoleCommand($"bind {keyName[i]} onpress {keyName[i]}");
        }
        
        [ConsoleCommand("onpress")]
        private void cmdOnPress(ConsoleSystem.Arg arg)
        {
            if(arg.connection == null) return;
            var player = arg.Player();
            var nameKey = arg.Args[0];
            
            DetectMessage($"<color=#228B22>{player.displayName}</color><color=#00FF7F> Pressed Suspicious Key</color> <color=red>{nameKey}</color><color=#1E90FF>.\n Check out this Player.</color>");
        }

        private void DetectMessage(string message)
        {
            foreach (var player in BasePlayer.activePlayerList)
            {
                if(permission.UserHasPermission(player.UserIDString, Permission) || player.IsAdmin())
                    SendReply(player, message);
            }
        }
    }
}
You can only detect input that is sent to the server, most of which would not be those. Input would be things such as FORWARD, BACKWARD, USE, SPRINT, etc. It isn't really possible to log any key you want.
5e13a8d5b2bc5.jpg Wulf
You can only detect input that is sent to the server, most of which would not be those. Input would be things such as FORWARD, BACKWARD, USE, SPRINT, etc. It isn't really possible to log any key you want.

Ok got you, thanks. So no actual then.

I don't think there is a way to do that, not without client-side modificatons where the client sends that info to the server.
Locked automatically