Пример #1
0
        private void customClear(BasePlayer player, string command, string[] args)
        {
            if (args.Length >= 1)
            {
                RaycastHit hit = new RaycastHit();
                if (Physics.Raycast(player.eyes.HeadRay(), out hit, float.MaxValue))
                {
                    var entity = hit.GetEntity();
                    if (entity.GetBuildingPrivilege().authorizedPlayers.Any(x => x.userid == player.userID))
                    {
                        if (entity is SamSite)
                        {
                            String ID = entity.GetInstanceID().ToString();
                            //removing msgs
                            DynamicConfigFile warnings = Interface.Oxide.DataFileSystem.GetDatafile("warningMsgs");
                            DynamicConfigFile firings  = Interface.Oxide.DataFileSystem.GetDatafile("firingMsgs");
                            warnings.Remove(ID);
                            firings.Remove(ID);

                            player.ChatMessage("custom Messages removed");
                        }
                        else
                        {
                            player.ChatMessage("you are not looking at a SAM Site!");
                        }
                    }
                    else
                    {
                        player.ChatMessage("you are not authorized here!");
                    }
                }
            }
        }
Пример #2
0
 private void TestCommand3(IPlayer player, string command, string[] args)
 {
     dataFile.Remove("EpicString");
     dataFile.Save();
 }