public void ShowDialogLogin(string password) { var login = new InputDialog($"{Color.Orange}Iniciar Sesión", "Esta cuenta sí está registrada.\nIngrese una contraseña:", true, "Aceptar", ""); login.Show(this); login.Response += (sender, e) => { if (e.DialogButton == DialogButton.Left) { Validate.IsEmpty(this, login, e.InputText); Validate.IsPasswordRange(this, login, e.InputText); if (password != DataBase.PlayerAccount.Account.Encrypt(e.InputText)) { login.Message = "La contraseña que ingresaste es incorrecta.\nIngrese una contraseña:"; login.Show(this); return; } if (Data.LevelVip == 3) { Adrenaline = 100; } CmdPublic.StatsPlayer(this); Account = AccountState.None; SendClientMessage(Color.Orange, $"[Cuenta]: {Color.Yellow}Has iniciado sesión de forma exitosa!"); AddLevels(this); } else { base.Kick(); } }; }
protected override void OnPlayerKeyStateChanged(BasePlayer sender, KeyStateChangedEventArgs e) { base.OnPlayerKeyStateChanged(sender, e); var player = sender as Player; if (Pressed(e, Keys.Walk, Keys.Crouch)) { if (player.SpecialAction == SpecialAction.Duck) { player.ToggleControllable(true); } CmdPublic.PacketWeapons(player); } else if (Pressed(e, Keys.Walk, Keys.CtrlBack)) { CmdPublic.ListCommands(player); } else if (HasPressed(e, Keys.Yes)) { CmdPublic.Weapons(player); } else if (HasPressed(e, Keys.No)) { CmdPublic.UsersList(player); } else if (HasPressed(e, Keys.CtrlBack)) { CmdPublic.Combos(player); } else if (HasPressed(e, Keys.AnalogLeft)) { CmdPublic.TopTen(player); } else if (HasPressed(e, Keys.AnalogRight)) { CmdPublic.Help(player); } if (!player.IsCapturedFlag() && (player.JumpOn || player.IsEnableJump()) && HasPressed(e, Keys.Jump)) { player.Velocity = new Vector3(player.Velocity.X, player.Velocity.Y, 0.24); } if (player.IsEnableSpeed() && HasPressed(e, Keys.Sprint)) { player.ApplyAnimation("PED", "sprint_civi", 100, true, true, true, true, 500); } }