Hi,
Is the Rust have any server command where can I list the sleeper players?
The 'status' is give me only the online players list, but I want to somehow listing the sleepers too (without teleport to them).
Is it possible from original command or it's working only with plugin (eg. with Finder maybe?) ?
Solved Command to list sleepers?
Discussion in 'Rust Discussion' started by SpiderCorsa, Apr 6, 2017.
-
Code:
namespace Oxide.Plugins { [Info("PlayerCounter", "redBDGR", "1.0.0")] [Description("Listing of all online / sleeping players")] class PlayerCounter : RustPlugin { public const string permissionName = "onlineplayers.use"; void Init() => permission.RegisterPermission(permissionName, this); [ChatCommand("onlineplayers")] void onlineplayersCMD(BasePlayer player, string command, string[] args) { if (!permission.UserHasPermission(player.UserIDString, permissionName)) return; int x = 1; foreach (BasePlayer user in BasePlayer.activePlayerList) { Puts($"{x.ToString()}. {user.displayName} | {user.UserIDString}"); x++; } } [ChatCommand("sleepingplayers")] void sleepingplayersCMD(BasePlayer player, string command, string[] args) { if (!permission.UserHasPermission(player.UserIDString, permissionName)) return; int x = 1; foreach (BasePlayer user in BasePlayer.sleepingPlayerList) { Puts($"{x.ToString()}. {user.displayName} | {user.UserIDString}"); x++; } } } }
-