diff --git a/ReallifeGamemode.Client/Gui/deathscreen.ts b/ReallifeGamemode.Client/Gui/deathscreen.ts index 8374bd18..32826cce 100644 --- a/ReallifeGamemode.Client/Gui/deathscreen.ts +++ b/ReallifeGamemode.Client/Gui/deathscreen.ts @@ -1,4 +1,4 @@ -/** +/** * @overview Life of German Reallife - Gui Infobox infobox.js * @author VegaZ * @copyright (c) 2008 - 2018 Life of German @@ -68,7 +68,7 @@ export default function deathScreen() { var medicString; if (dutyMedics > 0) { - medicString = "Das L.S.E.D. wurde benachrichtigt\nDerzeit"; + medicString = "Das L.S.E.D. wurde benachrichtigt\nDerzeit "; if (dutyMedics === 1) { medicString += "befindet sich ~g~" + dutyMedics + " Mitglied"; } else { @@ -108,4 +108,4 @@ export default function deathScreen() { } } }); -} \ No newline at end of file +} diff --git a/ReallifeGamemode.Client/Gui/interiors.ts b/ReallifeGamemode.Client/Gui/interiors.ts index d4736eb0..a26195bf 100644 --- a/ReallifeGamemode.Client/Gui/interiors.ts +++ b/ReallifeGamemode.Client/Gui/interiors.ts @@ -1,4 +1,4 @@ -import game from ".."; +import game from ".."; import { Key } from "../game"; var interiorId = -1; @@ -14,7 +14,7 @@ game.events.add('SERVER:InteriorManager_ClearHelpText', () => { game.events.add('SERVER:InteriorManager_ShowHelpText', (interior, intId, entEx) => { //game.ui.setHelpText('Drücke ~INPUT_CONTEXT~, um ~b~' + interior + ' ~s~zu ' + (entEx === 0 ? 'betreten' : 'verlassen')); - helpText = "~s~Drücke ~g~E~s~ um ~b~" + interior + " ~s~zu " + (entEx === 0 ? "betreten" : "verlassen"); + helpText = "~s~Drücke ~g~E~s~, um ~b~" + interior + " ~s~zu " + (entEx === 0 ? "betreten" : "verlassen"); mp.events.call("renderHelpTextOnScreen", helpText) interiorId = intId; enterExit = entEx; @@ -25,4 +25,4 @@ game.events.add('SERVER:InteriorManager_ShowHelpText', (interior, intId, entEx) function keyPressHandler() { if (game.ui.inChat) return; game.events.callServer('InteriorManager_UseTeleport', [interiorId, enterExit]); -} \ No newline at end of file +} diff --git a/ReallifeGamemode.Client/Jobs/BusRouteSelect.ts b/ReallifeGamemode.Client/Jobs/BusRouteSelect.ts index 7ef6fb35..c5c33244 100644 --- a/ReallifeGamemode.Client/Jobs/BusRouteSelect.ts +++ b/ReallifeGamemode.Client/Jobs/BusRouteSelect.ts @@ -19,19 +19,28 @@ let cancelItem = new UIMenuItem("Abbrechen", ""); cancelItem.BackColor = new Color(213, 0, 0); cancelItem.HighlightedBackColor = new Color(229, 57, 53); +var routeMenu: NativeUI.Menu; +var busRouteSelectColShape = mp.colshapes.newCircle(-535, -2144, 2.5); + export default function busRouteList(globalData: IGlobalData) { - var routeMenu: NativeUI.Menu; var skillSelect; var routeSelect; var skill = 0; var routeSelected = false; + mp.events.add(RageEnums.EventKey.PLAYER_EXIT_COLSHAPE, (colshape) => { + if (colshape == busRouteSelectColShape) { + if (routeMenu && routeMenu.Visible) { + routeMenu.Close(); + } + } + }); + mp.events.add('SERVER:StartBusJob', (jobskill) => { skill = jobskill; if (!globalData.InMenu) { globalData.InMenu = true; - mp.gui.cursor.show(true, true); skillSelect = ["Anfänger", "Fortgeschrittener", "Profi"]; routeMenu = new Menu("Bus Job", "", new Point(0, screenRes.y / 3), null, null); @@ -69,9 +78,7 @@ export default function busRouteList(globalData: IGlobalData) { } else if (item.Text === "Abbrechen") { - mp.events.callRemote("CLIENT:Job_StopJob"); routeMenu.Close(); - globalData.InMenu = false; } }); @@ -80,8 +87,7 @@ export default function busRouteList(globalData: IGlobalData) { mp.events.callRemote("CLIENT:Job_StopJob"); } routeSelected = false; - mp.gui.cursor.show(true, true); - + globalData.InMenu = false; }); } diff --git a/ReallifeGamemode.Client/Player/antiafk.ts b/ReallifeGamemode.Client/Player/antiafk.ts index 28960330..229cd705 100644 --- a/ReallifeGamemode.Client/Player/antiafk.ts +++ b/ReallifeGamemode.Client/Player/antiafk.ts @@ -17,7 +17,7 @@ let distance = mp.game.gameplay.getDistanceBetweenCoords(lp.x, lp.y, lp.z, np.x, np.y, np.z, false); - if (distance <= 3) { + if (distance <= 1.5) { if (!afkStatus) { afkCounter++; } diff --git a/ReallifeGamemode.Client/Player/handsup.ts b/ReallifeGamemode.Client/Player/handsup.ts index ca29ae5f..812689e5 100644 --- a/ReallifeGamemode.Client/Player/handsup.ts +++ b/ReallifeGamemode.Client/Player/handsup.ts @@ -4,8 +4,6 @@ var isStopped = player.isStopped(); - mp.gui.chat.push("isStopped = " + isStopped); - if (isStopped) { mp.events.callRemote("CLIENT:Handsup_TogglePlayerHup"); } diff --git a/ReallifeGamemode.Client/admin/anticheat.ts b/ReallifeGamemode.Client/admin/anticheat.ts index 44807c32..b7d0a03f 100644 --- a/ReallifeGamemode.Client/admin/anticheat.ts +++ b/ReallifeGamemode.Client/admin/anticheat.ts @@ -32,7 +32,7 @@ }); mp.events.add("client:checkInvincible", () => { - if (mp.players.local.dimension == 0) return + //if (mp.players.local.dimension == 0) return if (!Behaviour.active) return var healthBefore = Behaviour.health mp.players.local.applyDamageTo(1, true); @@ -49,9 +49,9 @@ }, 500); }) - setInterval(() => { - mp.events.call("client:checkInvincible") - }, 30000); + //setInterval(() => { + // mp.events.call("client:checkInvincible") + //}, 30000); mp.events.add('SERVER:AntiCheat:weaponSwap', () => { Behaviour.resetWeapon() @@ -62,7 +62,7 @@ mp.events.callRemote("CLIENT:CheatDetection", "Unallowed Weapon", Behaviour.weapon) } if (Behaviour.reloadingWeapon) { - mp.events.callRemote("CLIENT:CheatDetection", "No Reload") + //mp.events.callRemote("CLIENT:CheatDetection", "No Reload") Behaviour.resetWeapon() } Behaviour.updateMagSize() @@ -182,9 +182,24 @@ var Behaviour = new PlayerBehaviour() var loop = Behaviour.secs() + function isUsingController() { + return !mp.game.controls.isInputDisabled(0); + } + mp.events.add("render", () => { mp.game.player.setHealthRechargeMultiplier(0); + if (isUsingController()) { + mp.game.controls.disableControlAction(32, 24, true); + mp.game.controls.disableControlAction(32, 25, true); + + mp.game.controls.disableControlAction(32, 91, true); + mp.game.controls.disableControlAction(32, 92, true); + + mp.game.controls.disableControlAction(32, 69, true); + mp.game.controls.disableControlAction(32, 70, true); + } + Behaviour.health = Number(mp.players.local.getHealth()) + Number(mp.players.local.getArmour()) if (loop < Behaviour.secs()) { if (Behaviour.active) { diff --git a/ReallifeGamemode.Client/assets/css/onlinelist/style.css b/ReallifeGamemode.Client/assets/css/onlinelist/style.css index 28dd56ed..a60e49cf 100644 --- a/ReallifeGamemode.Client/assets/css/onlinelist/style.css +++ b/ReallifeGamemode.Client/assets/css/onlinelist/style.css @@ -19,8 +19,8 @@ html, body { } body { - margin: 15vh auto 0; - width: 32vw; + margin: 10vh auto 0; + width: 35vw; color: white; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 1em; @@ -49,13 +49,23 @@ h2 { -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; - margin-bottom: 1.5em; + margin-bottom: 1em; padding: 1em 1em 0; } +.factions { + position: -webkit-sticky; + position: sticky; + top: 0; + z-index: 3; + font-size: .9em; + background-color: black; + padding: 1em 0; +} + .wrapper { - min-height: 50vh; - max-height: 70vh; + min-height: 60vh; + max-height: 80vh; overflow-y: scroll; border-radius: .25em; background-color: rgba(0, 0, 0, 0.75); @@ -74,7 +84,7 @@ table { table th { position: -webkit-sticky; position: sticky; - top: 0; + top: 3em; text-align: left; z-index: 2; background-color: black; @@ -203,19 +213,7 @@ ol.inline.stats { justify-content: center; } -ol.inline.stats:first-of-type { - margin-top: 1em !important; -} - -ol.inline.stats:last-of-type { - margin-bottom: 1em; -} - -ol.inline.stats:not(:last-of-type) { - margin-bottom: .125em; -} - ol.inline.stats abbr { text-decoration: none; } -/*# sourceMappingURL=style.css.map */ \ No newline at end of file +/*# sourceMappingURL=style.css.map */ diff --git a/ReallifeGamemode.Client/assets/css/onlinelist/style.css.map b/ReallifeGamemode.Client/assets/css/onlinelist/style.css.map index 74b823b9..3f63b940 100644 --- a/ReallifeGamemode.Client/assets/css/onlinelist/style.css.map +++ b/ReallifeGamemode.Client/assets/css/onlinelist/style.css.map @@ -1,6 +1,6 @@ { "version": 3, - "mappings": "AAAA,AAAA,IAAI,CAAC;EACH,UAAU,EAAE,UAAU;EACtB,MAAM,EAAE,KAAK;EACb,UAAU,EAAE,WAAW;EACvB,WAAW,EAAE,IAAI;CAClB;;AAED,AAAA,IAAI,EAAE,IAAI,CAAC;EAAE,MAAM,EAAE,KAAK;CAAI;;AAC9B,AAAA,CAAC,EAAE,CAAC,AAAA,OAAO,EAAE,CAAC,AAAA,MAAM,CAAC;EAAE,UAAU,EAAE,OAAO;CAAI;;AAE9C,AAAA,IAAI,CAAC;EACH,MAAM,EAAE,WAAW;EAEnB,KAAK,EAAE,IAAI;EACX,KAAK,EAAE,KAAK;EAEZ,WAAW,EAAE,oIAAoI;EACjJ,SAAS,EAAE,GAAG;CACf;;AAED,AAAA,EAAE,EAAE,EAAE,CAAC;EACL,MAAM,EAAE,KAAK;EACb,WAAW,EAAE,CAAC;CACf;;AAED,AAAA,EAAE,CAAC;EAAE,SAAS,EAAE,MAAM;CAAI;;AAC1B,AAAA,EAAE,CAAC;EAAE,SAAS,EAAE,OAAO;CAAI;;AAE3B,AAAA,QAAQ,CAAC;EACP,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,aAAa;EAC9B,WAAW,EAAE,UAAU;EACvB,aAAa,EAAE,KAAK;EACpB,OAAO,EAAE,SAAS;CACnB;;AAED,AAAA,QAAQ,CAAC;EACP,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,MAAM;EAElB,aAAa,EAAE,KAAK;EACpB,gBAAgB,EAAE,mBAAkB;CAGrC;;AATD,AAQE,QARM,AAQL,mBAAmB,CAAC;EAAE,OAAO,EAAE,IAAI;CAAI;;AAG1C,AAAA,KAAK,CAAC;EACJ,eAAe,EAAE,QAAQ;EACzB,KAA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GE,EAHA,AAAA,OAAO,AAAA,MAAM,CAGb,IAAI,CAAC;EAAE,eAAe,EAAE,IAAI;CAAI", "sources": [ "style.scss" ], diff --git a/ReallifeGamemode.Client/assets/css/onlinelist/style.scss b/ReallifeGamemode.Client/assets/css/onlinelist/style.scss index 6486aa77..305684ad 100644 --- a/ReallifeGamemode.Client/assets/css/onlinelist/style.scss +++ b/ReallifeGamemode.Client/assets/css/onlinelist/style.scss @@ -9,9 +9,9 @@ html, body { margin: unset; } *, *:before, *:after { box-sizing: inherit; } body { - margin: 15vh auto 0; + margin: 10vh auto 0; - width: 32vw; + width: 35vw; color: white; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; @@ -30,17 +30,28 @@ h2 { font-size: 1.125em; } display: flex; justify-content: space-between; align-items: flex-start; - margin-bottom: 1.5em; + margin-bottom: 1em; padding: 1em 1em 0; } +.factions { + position: sticky; + top: 0; + z-index: 3; + + font-size: .9em; + background-color: black; + + padding: 1em 0; +} + .wrapper { - min-height: 50vh; - max-height: 70vh; + min-height: 60vh; + max-height: 80vh; overflow-y: scroll; border-radius: .25em; - background-color: rgba(0, 0, 0, .75); + background-color: rgba(black, .75); &::-webkit-scrollbar { display: none; } } @@ -52,7 +63,7 @@ table { th { position: sticky; - top: 0; + top: 3em; text-align: left; z-index: 2; @@ -129,10 +140,6 @@ ol.inline { ol.inline.stats { justify-content: center; - - &:first-of-type { margin-top: 1em !important; } - &:last-of-type { margin-bottom: 1em; } - &:not(:last-of-type) { margin-bottom: .125em; } abbr { text-decoration: none; } -} +} \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/html/onlinelist/index.html b/ReallifeGamemode.Client/assets/html/onlinelist/index.html index ed0290f9..5e54c6d3 100644 --- a/ReallifeGamemode.Client/assets/html/onlinelist/index.html +++ b/ReallifeGamemode.Client/assets/html/onlinelist/index.html @@ -5,7 +5,7 @@ Spielerliste - +
@@ -14,6 +14,21 @@

Spieler: 0

+
+
    +
  1. LSPD: 0
  2. +
  3. FIB: 0
  4. +
  5. LSED: 0
  6. + +
  7. GSF: 0
  8. +
  9. FYB: 0
  10. +
  11. LSV: 0
  12. + +
  13. WZN: 0
  14. +
  15. ZIVI: 0
  16. +
+
+ @@ -27,26 +42,8 @@
- -
    -
  1. LSPD: 0
  2. -
  3. FIB: 0
  4. -
  5. LSED: 0
  6. -
- -
    -
  1. GSF: 0
  2. -
  3. FYB: 0
  4. -
  5. LSV: 0
  6. -
- -
    -
  1. WZN: 0
  2. -
  3. Zivilisten: 0
  4. -
- - - + + diff --git a/ReallifeGamemode.Client/assets/js/onlinelist/script.js b/ReallifeGamemode.Client/assets/js/onlinelist/script.js index e6a5154c..a662711b 100644 --- a/ReallifeGamemode.Client/assets/js/onlinelist/script.js +++ b/ReallifeGamemode.Client/assets/js/onlinelist/script.js @@ -1,12 +1,9 @@ window.onbeforeunload = () => { window.scrollTo(0, 0); } -$(document).ready(function () { - mp.trigger('CEF:PlayerList_Loaded'); -}); - setPlayerCount = (factionId, value) => { if (factionId == -1) { document.getElementById('player-count').innerHTML = value; + addTableSorting(); } else if (factionId >= 0 && factionId <= 9) { document.getElementById(factionId).innerHTML = value; } @@ -30,3 +27,34 @@ function addPlayerEntry(userId, userName, factionId, userPing) { var factionName = getFactionNameByFactionId(factionId); document.getElementById('players').innerHTML += `${userId} ${userName} ${factionName} ${userPing}`; } + +// https://www.jstips.co/en/javascript/detect-document-ready-in-pure-js/ +document.onreadystatechange = () => { + if (document.readyState === 'complete') { mp.trigger('CEF:PlayerList_Loaded'); } +}; + +// Sortierung von https://codepen.io/selbekk/pen/LNOZKL +function addTableSorting() { + const headers = Array.from(document.querySelectorAll('th')); + const rows = Array.from(document.querySelectorAll('tbody tr')); + + function sort(e) { + const index = headers.indexOf(e.target); + const sortVal = e.target.classList.contains('is-asc') ? 1 : -1; + rows.sort((a, b) => { + const aValue = a.children[index].innerHTML; + const bValue = b.children[index].innerHTML; + if(aValue > bValue) { return sortVal; } + if(aValue < bValue) { return -sortVal; } + return 0; + }) + + e.target.classList.add('is-sorted'); + e.target.classList.toggle('is-asc'); + const body = document.querySelector('tbody'); + body.innerHTML = ''; + rows.forEach(row => body.appendChild(row)); + } + + headers.forEach(header => header.addEventListener('click', sort)); +} diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 65c42c54..d6ba2c51 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -268,6 +268,9 @@ antiAfk(globalData); import ammunation from './Interaction/ammunation/ammunation'; ammunation(globalData); +import handsup from './Player/handsup'; +handsup(); + import charSurgery from './CharCreator/surgery'; charSurgery(globalData); diff --git a/ReallifeGamemode.Client/util/planeschool.ts b/ReallifeGamemode.Client/util/planeschool.ts index 992b871e..d4dcd187 100644 --- a/ReallifeGamemode.Client/util/planeschool.ts +++ b/ReallifeGamemode.Client/util/planeschool.ts @@ -1,4 +1,4 @@ -import * as NativeUI from '../libs/NativeUI'; +import * as NativeUI from '../libs/NativeUI'; const Menu = NativeUI.Menu; const UIMenuItem = NativeUI.UIMenuItem; const UIMenuListItem = NativeUI.UIMenuListItem; @@ -25,9 +25,7 @@ export default function planeSchoolHandle(globalData: IGlobalData) { var waitFinished = false; mp.events.add('planeSchoolMenu', () => { - mp.game.ui.setTextComponentFormat('STRING'); - mp.game.ui.addTextComponentSubstringPlayerName('Drücke ~INPUT_CONTEXT~, um das Flugschulmenü zu öffnen'); - mp.game.ui.displayHelpTextFromStringLabel(0, true, true, -1); + mp.events.call("renderHelpTextOnScreen", "~s~Drücke ~g~E~s~, um die ~b~Flugprüfung ~s~zu beginnen"); mp.keys.bind(0x45, false, keyPressHandler); keyBound = true; }); @@ -67,4 +65,4 @@ export default function planeSchoolHandle(globalData: IGlobalData) { mp.events.call('removeplaneSchoolMenu', false); mp.events.callRemote('startplaneSchool'); } -} \ No newline at end of file +} diff --git a/ReallifeGamemode.Server/Bank/bank.cs b/ReallifeGamemode.Server/Bank/bank.cs index 1781103e..6b2788d8 100644 --- a/ReallifeGamemode.Server/Bank/bank.cs +++ b/ReallifeGamemode.Server/Bank/bank.cs @@ -151,7 +151,7 @@ namespace ReallifeGamemode.Server.Bank { player.SendNotification($"~w~Du hast {target.Name} $~g~{amount} ~w~Überwiesen."); player.GetUser(dbContext).BankAccount.Balance -= (int)(amount * 1.05); - target.GetUser(dbContext).otheramount = amount; + target.GetUser(dbContext).otheramount += amount; dbContext.SaveChanges(); } } @@ -203,7 +203,7 @@ namespace ReallifeGamemode.Server.Bank { player.SendNotification($"~w~Du hast {target.Name} $~g~{amount} ~w~Überwiesen."); player.GetUser(dbContext).Faction.BankAccount.Balance -= (int)(amount * 1.05); - target.GetUser(dbContext).otheramount = amount; + target.GetUser(dbContext).otheramount += amount; dbContext.SaveChanges(); } } diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index bc191b5c..dedd99e7 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; @@ -165,12 +165,6 @@ namespace ReallifeGamemode.Server.Commands [Command("position", "~m~Benutzung: ~s~/position")] public void CmdAdminPosition(Player player) { - if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) - { - ChatService.NotAuthorized(player); - return; - } - ChatService.SendMessage(player, "Position: X Y Z: " + player.Position + " Richtung: " + player.Heading); } @@ -1358,7 +1352,7 @@ namespace ReallifeGamemode.Server.Commands if (target.GetData("isDead") == true) { - ChatService.ErrorMessage(player, "Dieser Spieler ist tot. Nutze /arevive."); + ChatService.ErrorMessage(player, "Dieser Spieler ist tot. Nutze /arevive"); return; } diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index 7b4bc1c7..1afc483c 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -120,7 +120,7 @@ namespace ReallifeGamemode.Server.Commands } [Command("help", "~m~Benutzung: ~s~/help")] - public void CmdHelp(Player player) + public void CmdUserHelp(Player player) { player.SendChatMessage("E - Interagieren (ATM, Türen, Shops, Friseur etc."); player.SendChatMessage("M - Interaktionsmenü öffnen und schließen"); @@ -129,7 +129,7 @@ namespace ReallifeGamemode.Server.Commands player.SendChatMessage("O - Onlineliste öffnen / schließen"); player.SendChatMessage("I - Inventar öffnen / schließen"); player.SendChatMessage("F4 - Mikrofon an/aus schalten"); - player.SendChatMessage("/skill - Skillpunkte anzeigen"); + player.SendChatMessage("/report - Support-Anfrage"); } [Command("hup")] diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index d77d8243..9f075e1d 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -632,10 +632,9 @@ namespace ReallifeGamemode.Server.Events if(player.GetData("SellVehicleDecision") == true && player.HasData("VehicleToSell")) { - InteractionManager.SellPlayerVehicle(player, player.GetData("VehicleToSell")); + InteractionManager.SellServerVehicle(player, player.GetData("VehicleToSell")); player.ResetData("SellVehicleDecision"); - player.ResetData("VehicleToSell"); - player.SendNotification("~g~Du hast dein Fahrzeug verkauft"); + player.ResetData("VehicleToSell"); return; } diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 62d21e39..a4357238 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using GTANetworkAPI; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; @@ -100,7 +100,7 @@ namespace ReallifeGamemode.Server.Events if (user.Wanteds > 0) { - ChatService.HQMessage("Der Straftäter" + user.Name + " hat sich mit " + user.Wanteds + " Wanteds eingeloggt."); + ChatService.HQMessage("Der Straftäter " + user.Name + " hat sich mit " + user.Wanteds + " Wanteds eingeloggt."); } if (user.Wanteds == 0) diff --git a/ReallifeGamemode.Server/Events/Register.cs b/ReallifeGamemode.Server/Events/Register.cs index 37baf622..c736a54f 100644 --- a/ReallifeGamemode.Server/Events/Register.cs +++ b/ReallifeGamemode.Server/Events/Register.cs @@ -29,9 +29,9 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("SERVER:Login_Error", "Das Passwort muss aus mindestens 6 Zeichen bestehen."); return; } - if (dbContext.Users.Where(u => u.SocialClubName == player.SocialClubName).Count() >= 3) + if (dbContext.Users.Where(u => u.SocialClubName == player.SocialClubName).Count()!= 0) { - player.TriggerEvent("SERVER:Login_Error", "Es sind schon 3 Konten mit dieser Socialclub-ID registriert."); + player.TriggerEvent("SERVER:Login_Error", "Es ist schon ein Konto mit dieser Socialclub-ID registriert."); return; } diff --git a/ReallifeGamemode.Server/Factions/Medic/Medic.cs b/ReallifeGamemode.Server/Factions/Medic/Medic.cs index 50ef6941..1bc98dcd 100644 --- a/ReallifeGamemode.Server/Factions/Medic/Medic.cs +++ b/ReallifeGamemode.Server/Factions/Medic/Medic.cs @@ -195,6 +195,21 @@ namespace ReallifeGamemode.Server.Factions.Medic } } + public static void RemoveOldHealTask() + { + if (HealTasks.Count != 0) + { + foreach (var task in HealTasks.ToList()) + { + var taskActive = DateTime.Now - task.Time; + if (taskActive > TimeSpan.FromMinutes(10) && task.MedicName == "none") + { + delHealTask(PlayerService.GetPlayerByNameOrId(task.Victim)); + } + } + } + } + [RemoteEvent("loadMedicTasks")] public void LoadMedicTasks(Player player, int type) { diff --git a/ReallifeGamemode.Server/Gangwar/Gangwar.cs b/ReallifeGamemode.Server/Gangwar/Gangwar.cs index 2f03c031..56d7f42d 100644 --- a/ReallifeGamemode.Server/Gangwar/Gangwar.cs +++ b/ReallifeGamemode.Server/Gangwar/Gangwar.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using GTANetworkAPI; using Newtonsoft.Json; @@ -145,7 +145,7 @@ namespace ReallifeGamemode.Server.Gangwar int id = JsonConvert.DeserializeObject(jsonId); if (id == -1) { - ChatService.ErrorMessage(client, "Du befindest dich in keinem Gebiet!"); + ChatService.ErrorMessage(client, "Du befindest dich in keinem Gebiet"); return; } using (var dbContext = new DatabaseContext()) diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index 809af885..8f0466c5 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -217,8 +217,8 @@ namespace ReallifeGamemode.Server.Gangwar { using (var dbContext = new DatabaseContext()) { - ChatService.BroadcastFaction("~y~[GANGWAR] ~r~" + client.Name + "~w~ ist nicht im Gangwar beteiligt !", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault()); - ChatService.BroadcastFaction("~y~[GANGWAR] ~r~" + client.Name + "~w~ ist nicht im Gangwar beteiligt !", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault()); + ChatService.BroadcastFaction("~y~[GANGWAR] ~r~" + client.Name + "~w~ ist nicht im Gangwar beteiligt!", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault()); + ChatService.BroadcastFaction("~y~[GANGWAR] ~r~" + client.Name + "~w~ ist nicht im Gangwar beteiligt!", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault()); } return; } @@ -332,7 +332,7 @@ namespace ReallifeGamemode.Server.Gangwar List leaders = context.Users.Include(u => u.Faction).Where(u => onlinePlayers.Contains(u.Name) && u.Faction.Name == attacker && u.FactionLeader).Select(u => u.Player).ToList(); foreach (var l in leaders) { - ChatService.ErrorMessage(l, "Gangwarstart ist nicht möglich, da die beteiligten Fraktionen nicht genügend Mitglieder aufweisen."); + ChatService.ErrorMessage(l, "Du kannst keinen Gangwar starten, weil in der gegnerischen Fraktion zu wenig Spieler online sind"); } return; diff --git a/ReallifeGamemode.Server/Inventory/Items/ConsumableItem.cs b/ReallifeGamemode.Server/Inventory/Items/ConsumableItem.cs index 076b28cd..d5a96232 100644 --- a/ReallifeGamemode.Server/Inventory/Items/ConsumableItem.cs +++ b/ReallifeGamemode.Server/Inventory/Items/ConsumableItem.cs @@ -30,14 +30,14 @@ namespace ReallifeGamemode.Server.Inventory.Items if (!HasCooldownElapsed(user)) { - DateTime time = InventoryManager.itemCooldown[user]; + DateTime time = InventoryManager.itemCooldown[user.Id]; int timeUntillNextUse = (int)(time - DateTime.Now).TotalSeconds; uItem.GetUser().Player.TriggerEvent("Error", $"Versuche es nach {timeUntillNextUse} Sekunden erneut."); return false; } DateTime cooldown = DateTime.Now.AddMilliseconds(Cooldown); - InventoryManager.itemCooldown.Add(user, cooldown); + InventoryManager.itemCooldown.Add(user.Id, cooldown); Consume(uItem); return true; @@ -48,13 +48,13 @@ namespace ReallifeGamemode.Server.Inventory.Items if (user.Player == null || !user.Player.IsLoggedIn()) return false; - if (!InventoryManager.itemCooldown.ContainsKey(user)) + if (!InventoryManager.itemCooldown.ContainsKey(user.Id)) return true; - int timeRemaining = (int)(InventoryManager.itemCooldown[user] - DateTime.Now).TotalSeconds; + int timeRemaining = (int)(InventoryManager.itemCooldown[user.Id] - DateTime.Now).TotalSeconds; if (timeRemaining <= 0) - InventoryManager.itemCooldown.Remove(user); + InventoryManager.itemCooldown.Remove(user.Id); return timeRemaining <= 0; } diff --git a/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs b/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs index 651fe8e1..cc187fc8 100644 --- a/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs +++ b/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using GTANetworkAPI; @@ -267,7 +267,7 @@ namespace ReallifeGamemode.Server.Job else if (data.getTrashCount() > MAX_BAG) { data.setTrashCount(MAX_BAG); - ChatService.ErrorMessage((Player)player, "Der Müllwagen ist schon voll."); + ChatService.ErrorMessage((Player)player, "Der Müllwagen ist schon voll"); } else { diff --git a/ReallifeGamemode.Server/Managers/InteractionManager.cs b/ReallifeGamemode.Server/Managers/InteractionManager.cs index 6bff91b8..1a4c30ca 100644 --- a/ReallifeGamemode.Server/Managers/InteractionManager.cs +++ b/ReallifeGamemode.Server/Managers/InteractionManager.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using GTANetworkAPI; using Newtonsoft.Json; @@ -479,21 +479,39 @@ namespace ReallifeGamemode.Server.Managers } } - public static void SellPlayerVehicle(Player player, int id) + public static void SellServerVehicle(Player player, int id) { using var dbContext = new DatabaseContext(); var user = player.GetUser(dbContext); - var userVehicle = dbContext.UserVehicles.Where(v => v.Id == id && v.UserId == user.Id).FirstOrDefault(); - var vehPrice = userVehicle.Price; - var backPrice = (int)(vehPrice * 0.4); - GTANetworkAPI.Vehicle veh = VehicleManager.GetVehicleFromServerVehicle(userVehicle); - user.BankAccount.Balance += backPrice; + ServerVehicle serverVehicle = dbContext.ServerVehicles.FirstOrDefault(v => v.Id == id); + + if(serverVehicle is UserVehicle) + { + UserVehicle userVehicle = dbContext.UserVehicles.Where(v => v.Id == id && v.UserId == user.Id).FirstOrDefault(); + var vehPrice = userVehicle.Price; + var backPrice = (int)(vehPrice * 0.4); + GTANetworkAPI.Vehicle veh = VehicleManager.GetVehicleFromServerVehicle(userVehicle); + user.BankAccount.Balance += backPrice; - ChatService.SendMessage(player, $"~b~[INFO]~s~ Du hast durch den Autoverkauf ~g~{backPrice.ToMoneyString()}~s~ erhalten."); + ChatService.SendMessage(player, $"~b~[INFO]~s~ Du hast durch den Autoverkauf ~g~{backPrice.ToMoneyString()}~s~ erhalten."); - VehicleManager.DeleteVehicle(veh); + VehicleManager.DeleteVehicle(veh); + dbContext.UserVehicles.Remove(userVehicle); + player.SendNotification("~g~Du hast dein Fahrzeug verkauft"); + } + else if(serverVehicle is FactionVehicle) + { + FactionVehicle factionVehicle = dbContext.FactionVehicles.FirstOrDefault(v => v.Id == id); + var backPrice = (int)(factionVehicle.BuyPrice * 1.5 * 0.4); + user.Faction.BankAccount.Balance += backPrice; - dbContext.UserVehicles.Remove(userVehicle); + ChatService.SendMessage(player, $"~b~[INFO]~s~ Die Fraktionskasse hat ~g~{backPrice.ToMoneyString()}~s~ erhalten."); + + VehicleManager.DeleteVehicle(VehicleManager.GetVehicleFromServerVehicle(factionVehicle)); + + dbContext.FactionVehicles.Remove(factionVehicle); + player.SendNotification("~g~Du hast dein Fraktionsfahrzeug verkauft"); + } dbContext.SaveChanges(); } @@ -533,10 +551,10 @@ namespace ReallifeGamemode.Server.Managers return; } - var factionVehicleCount = dbContext.FactionVehicles.ToList().Where(v => v.Id == id && v.GetOwners().Contains(user.FactionId.Value)).Count(); + var factionVehicleCount = dbContext.FactionVehicles.ToList().Where(v => v.GetOwners().Contains(user.FactionId.Value)).Count(); if (factionVehicleCount <= 6) { - ChatService.ErrorMessage(player, "Die Fraktion braucht mindestens 6 Fahrzeuge"); + ChatService.ErrorMessage(player, "Die Fraktion braucht mindestens sechs Fahrzeuge"); return; } @@ -546,16 +564,13 @@ namespace ReallifeGamemode.Server.Managers ChatService.ErrorMessage(player, "Das Fahrzeug konnte nicht verkauft werden. Bitte melde dich bei der Leaderverwaltung"); return; } + + var backPrice = (int)(price.Price * 1.5 * 0.4); - user.Faction.BankAccount.Balance += backPrice; - - ChatService.SendMessage(player, $"~b~[INFO]~s~ Die Fraktionskasse ~g~{backPrice.ToMoneyString()}~s~ erhalten."); - - VehicleManager.DeleteVehicle(veh); - - dbContext.FactionVehicles.Remove(factionVehicle); - dbContext.SaveChanges(); + player.SetData("SellVehicleDecision", true); + player.SetData("VehicleToSell", id); + ChatService.SendMessage(player, "~s~Möchtes du das Fahrzeug ~y~" + veh.DisplayName + " ~s~wirklich für ~g~$" + backPrice + " ~s~verkaufen? Drücke ~g~J~s~ zum Bestätigen oder ~r~N ~s~zum Abbrechen"); } } diff --git a/ReallifeGamemode.Server/Managers/InventoryManager.cs b/ReallifeGamemode.Server/Managers/InventoryManager.cs index 42953d00..d20a69b8 100644 --- a/ReallifeGamemode.Server/Managers/InventoryManager.cs +++ b/ReallifeGamemode.Server/Managers/InventoryManager.cs @@ -34,7 +34,7 @@ namespace ReallifeGamemode.Server.Managers public static Dictionary> backpackItems { get; set; } = new Dictionary>(); public static Dictionary> vehicleItems { get; set; } = new Dictionary>(); - public static Dictionary itemCooldown = new Dictionary(); + public static Dictionary itemCooldown = new Dictionary(); public class InventoryItem { diff --git a/ReallifeGamemode.Server/Managers/JobManager.cs b/ReallifeGamemode.Server/Managers/JobManager.cs index af5de97d..007228ac 100644 --- a/ReallifeGamemode.Server/Managers/JobManager.cs +++ b/ReallifeGamemode.Server/Managers/JobManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -66,7 +66,7 @@ namespace ReallifeGamemode.Server.Managers if (u.JobId == null) { - ChatService.ErrorMessage(player, "Du hast momentan keinen Job, den du kündigen könntest."); + ChatService.ErrorMessage(player, "Du bist bereits arbeitslos"); return; } @@ -89,20 +89,20 @@ namespace ReallifeGamemode.Server.Managers if (u.JobId != null) { - ChatService.ErrorMessage(player, "Du musst deinen alten Job kündigen, bevor du einen neuen ausüben kannst."); + ChatService.ErrorMessage(player, "Du musst deinen alten Job kündigen, bevor du einen Neuen ausüben kannst"); return; } //Pilotjob if (jobId == 3 && u.FlyingLicensePlane == false) { - ChatService.ErrorMessage(player, "Um diesen Job annehmen zu können, musst du einen Flugschein besitzen."); + ChatService.ErrorMessage(player, "Um diesen Job annehmen zu können, musst du einen Flugschein besitzen"); return; } if (u.DriverLicenseVehicle == false) { - ChatService.ErrorMessage(player, "Um diesen Job annehmen zu können, musst du einen Führerschein besitzen."); + ChatService.ErrorMessage(player, "Um diesen Job annehmen zu können, musst du einen Führerschein besitzen"); return; } @@ -202,9 +202,9 @@ namespace ReallifeGamemode.Server.Managers { JobBase job = GetJob(player.GetUser().JobId ?? -1); - if (job != null && job.GetUsersInJob().Contains(player) && seat == 0) + if (job != null && job.GetUsersInJob().Contains(player)) { - if(job.CheckVehicle(player, veh)) + if(job.CheckVehicle(player, veh) && seat == 0) { if (!playerTimersJobVehicleRespawn.ContainsKey(player)) return; diff --git a/ReallifeGamemode.Server/Report/Report.cs b/ReallifeGamemode.Server/Report/Report.cs index 344da53a..d07ed8c7 100644 --- a/ReallifeGamemode.Server/Report/Report.cs +++ b/ReallifeGamemode.Server/Report/Report.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using GTANetworkAPI; using Newtonsoft.Json; @@ -35,7 +35,7 @@ namespace ReallifeGamemode.Server.Report if (listReports.FindAll(e => (e.isAssigned() == false)).Count == 0) { - ChatService.ErrorMessage(client, "Im Moment gibt es keine Tickets."); + ChatService.ErrorMessage(client, "Aktuell gibt es keine Tickets"); return; } @@ -92,7 +92,8 @@ namespace ReallifeGamemode.Server.Report } } - ChatService.SendMessage(player, "!{#008fff}[REPORT]!{#FFFFFF} Admin " + admin.Name + " hat dein Ticket angenommen! (Benutze /rc zum Schreiben)"); + ChatService.SendMessage(player, "!{#008fff}[REPORT]!{#FFFFFF} Admin " + admin.Name + " hat dein Ticket angenommen! Über /rc [Text] kannst du mit dem Admin schreiben."); + ChatService.SendMessage(admin, "!{#008fff}[REPORT]!{#FFFFFF} Du hast das Ticket von " + player.Name + " angenommen! Über /rc [Text] kannst du mit dem User schreiben."); ChatService.BroadcastDutyAdmin("!{#008fff}[REPORT]!{#FFFFFF} " + admin.Name + " hat das Ticket von " + player.Name + " angenommen"); } diff --git a/ReallifeGamemode.Server/Util/ThreadTimers.cs b/ReallifeGamemode.Server/Util/ThreadTimers.cs index f0b2a057..7b5db17b 100644 --- a/ReallifeGamemode.Server/Util/ThreadTimers.cs +++ b/ReallifeGamemode.Server/Util/ThreadTimers.cs @@ -74,6 +74,7 @@ namespace ReallifeGamemode.Server.Util Economy.Timer_Elapsed(); WeaponDealManager.Timer_Elapsed(); Medic.UpdateReviveSperre(); + Medic.RemoveOldHealTask(); }); }