Beispiel #1
0
        public string[] OnCall(ICommandSender sender, string[] args)
        {
            if (sender is Player player)
            {
                if (args.Length > 0)
                {
                    string name = string.Empty;
                    for (int i = 0; i < args.Length; i++)
                    {
                        name += $"{args[i]}{(i != args.Length - 1 ? " " : "")}";
                    }

                    PlayerSpoof ps = new PlayerSpoof();
                    ps.pNormalName  = player.Name;
                    ps.pSpoofedName = name;
                    EventHandler.SpoofName(player, ps);

                    return(new[] { $"Your name has been spoofed to '{name}'." });
                }
                else
                {
                    EventHandler.UnSpoofName(player);
                    return(new[] { "Your name has been unspoofed." });
                }
            }
            else
            {
                return(new[] { "You must be a player to run this command." });
            }
        }
Beispiel #2
0
 public static void SpoofName(Player player, PlayerSpoof playerSpoof)
 {
     if (!spoofs.ContainsKey(player.SteamId))
     {
         spoofs.Add(player.SteamId, playerSpoof);
     }
     else
     {
         spoofs[player.SteamId].pSpoofedName = playerSpoof.pSpoofedName;
     }
     SetNickname(player, playerSpoof.pSpoofedName);
 }
Beispiel #3
0
        public void OnCallCommand(PlayerCallCommandEvent ev)
        {
            if (((GameObject)ev.Player.GetGameObject()).GetComponent <ServerRoles>().RemoteAdmin&& ev.Command.StartsWith("spoof"))
            {
                string name = ev.Command.Replace("spoof", "").Trim();
                if (name.Length > 0)
                {
                    PlayerSpoof ps = new PlayerSpoof();
                    ps.pNormalName  = ev.Player.Name;
                    ps.pSpoofedName = name;
                    SpoofName(ev.Player, ps);

                    ev.ReturnMessage = $"Your name has been spoofed to '{name}'.";
                }
                else
                {
                    UnSpoofName(ev.Player);
                    ev.ReturnMessage = "Your name has been unspoofed.";
                }
            }
        }