Esempio n. 1
0
        public Robberies(Server server) : base(server)
        {
            server.RegisterEventHandler("Robbery.AttemptStartRob", new Action <Player, string>(OnRobRequest));
            //server.RegisterEventHandler("Robbery.OnRobberyCompleted", new Action<Player>(OnRobberyComplete));
            server.RegisterEventHandler("Robbery.CheckCanRobStore", new Action <Player, string>(OnRobberyRequest));
            server.RegisterEventHandler("Robbery.RequestPayout", new Action <Player, string>(OnPayoutRequest));
            server.RegisterEventHandler("Robbery.RobberyIncomplete", new Action <string>(OnRobberyIncomplete));
            server.RegisterEventHandler("Robbery.CheckCanRobRegister", new Action <Player, string>(CheckCanRobRegister));
            server.RegisterEventHandler("Robbery.RequestRegisterPayment", new Action <Player, string>(OnRegisterPayment));
            createRobberyModels();

            CommandRegister.RegisterRCONCommand("getrobberystates", cmd =>
            {
                foreach (var location in robbableLocations)
                {
                    Log.Info("-----------------------------------------------------------------------------------------------------------------------");
                    Log.Info($"Locaion: {location.LocationName}");
                    Log.Info($"Cooldown time: {location.CooldownTime}");
                    Log.Info($"Is bank: {location.IsBank}");
                    Log.Info($"Is being robbed: {location.IsBeingRobbed}");
                    Log.Info($"Is robbable: {location.IsRobbable}");
                    Log.Info($"Required police: {location.RequiredPolice}");
                    Log.Info($"Times robbed: {location.TimesRobbed}");
                    Log.Info("-----------------------------------------------------------------------------------------------------------------------");
                }
            });
        }
Esempio n. 2
0
 public PropertyManager(Server server) : base(server)
 {
     CommandRegister.RegisterRCONCommand("listproperties", cmd =>
     {
         foreach (var property in properties)
         {
             Log.Info("-------------------------------------------------------");
             Log.Info(property.ToString());
             Log.Info("-------------------------------------------------------");
         }
     });
     CommandRegister.RegisterRCONCommand("saveproperties", cmd =>
     {
         saveAllProperties();
     });
     loadPropertyIds();
 }
Esempio n. 3
0
        public Admin(Server server) : base(server)
        {
            CommandRegister.RegisterAdminCommand("setadminlevel", SetPermissionLevel, AdminLevel.SuperAdmin);
            CommandRegister.RegisterAdminCommand("kick", KickPlayer, AdminLevel.Moderator);
            CommandRegister.RegisterAdminCommand("bring", OnBringCommand, AdminLevel.Admin);
            CommandRegister.RegisterAdminCommand("return", OnReturnCommand, AdminLevel.Admin);
            CommandRegister.RegisterAdminCommand("mute", OnMuteCommand, AdminLevel.Admin);
            CommandRegister.RegisterAdminCommand("unmute", OnUnMuteCommand, AdminLevel.Admin);
            CommandRegister.RegisterAdminCommand("freeze", OnFreezeCommand, AdminLevel.Admin);
            CommandRegister.RegisterAdminCommand("unfreeze", OnUnFreezeCommand, AdminLevel.Admin);
            CommandRegister.RegisterAdminCommand("announce", OnAnnounceCommand, AdminLevel.Admin);
            CommandRegister.RegisterAdminCommand("say", OnSayCommand, AdminLevel.SuperAdmin);
            CommandRegister.RegisterAdminCommand("playerlist", OnPlayerlistCommand, AdminLevel.Moderator);
            CommandRegister.RegisterAdminCommand("sc", OnStaffChatCommand, AdminLevel.Moderator);

            CommandRegister.RegisterRCONCommand("kickall", cmd =>
            {
                foreach (var player in /*Server.PlayerList.ToList()*/ Players.ToList())
                {
                    player.Drop(string.Join(" ", cmd.Args));
                }
            });
        }