Merge develop into ammunation
@@ -72,7 +72,7 @@ export default function carDealer(globalData: IGlobalData) {
|
||||
priceItem.SetRightLabel("~g~$~s~ " + moneyFormat(price));
|
||||
break;
|
||||
case 'Fraktion':
|
||||
priceItem.SetRightLabel("~g~$~s~ " + moneyFormat(price * 3));
|
||||
priceItem.SetRightLabel("~g~$~s~ " + moneyFormat(price * 1.5));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,15 @@
|
||||
playerBlipMap.set(player, pBlip);
|
||||
}
|
||||
let pBlip = playerBlipMap.get(player);
|
||||
if (player.isDead()) {
|
||||
pBlip.setSprite(303);
|
||||
} else {
|
||||
pBlip.setSprite(1);
|
||||
}
|
||||
let color = player.getVariable("blipColor");
|
||||
pBlip.setColour(isNaN(color) ? 0 : color);
|
||||
pBlip.setPosition(player.position.x, player.position.y, player.position.z);
|
||||
|
||||
});
|
||||
}, 50);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const colors = [
|
||||
export default function customNametags() {
|
||||
mp.nametags.enabled = false;
|
||||
|
||||
mp.events.add('render', (nametags) => {
|
||||
mp.events.add(RageEnums.EventKey.RENDER, (nametags) => {
|
||||
const graphics = mp.game.graphics;
|
||||
const screenRes = graphics.getScreenResolution(0, 0);
|
||||
|
||||
@@ -51,7 +51,13 @@ export default function customNametags() {
|
||||
|
||||
let color = colors.find(c => c.id === colorId).color;
|
||||
|
||||
mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y],
|
||||
let nametagText = player.name + " (" + player.remoteId + ")";
|
||||
|
||||
if (player.getVariable("isAfk")) {
|
||||
nametagText += " ~r~AFK";
|
||||
}
|
||||
|
||||
mp.game.graphics.drawText(nametagText, [x, y],
|
||||
{
|
||||
font: 4,
|
||||
color: [color[0], color[1], color[2], color[3]],
|
||||
|
||||
@@ -9,6 +9,44 @@ var screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
|
||||
export default function vehicleMenu(globalData: IGlobalData) {
|
||||
let menuBrowser: BrowserMp = null;
|
||||
var lastDriversBrowser: BrowserMp = null;
|
||||
|
||||
var lastDrivers = null;
|
||||
|
||||
mp.events.add('lookLastDrivers', (lastDriversParam) => {
|
||||
lastDrivers = JSON.parse(lastDriversParam);
|
||||
|
||||
if (lastDriversBrowser !== null) {
|
||||
lastDriversBrowser.destroy();
|
||||
lastDriversBrowser = null;
|
||||
globalData.InMenu = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
else if (!globalData.InMenu) {
|
||||
globalData.InMenu = true;
|
||||
lastDriversBrowser = mp.browsers.new('package://assets/vehicle/lastPlayers.html');
|
||||
mp.gui.chat.activate(false);
|
||||
mp.gui.cursor.show(true, true);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("CEF:VehicleLook_Loaded", () => {
|
||||
lastDriversBrowser.execute(`setDrivers('${JSON.stringify(lastDrivers)}');`);
|
||||
});
|
||||
|
||||
mp.events.add("removeLookMenu", () => {
|
||||
if (lastDriversBrowser == null) {
|
||||
return;
|
||||
}
|
||||
else if (globalData.InMenu) {
|
||||
lastDriversBrowser.destroy();
|
||||
lastDriversBrowser = null;
|
||||
globalData.InMenu = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
mp.gui.chat.activate(true);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add('ToggleVehicleMenu', () => {
|
||||
if (menuBrowser !== null) {
|
||||
|
||||
@@ -4,4 +4,8 @@
|
||||
mp.events.add("SERVER:SetWanteds", (count: number) => {
|
||||
browser.execute(`setWanteds(${count});`);
|
||||
});
|
||||
|
||||
mp.events.add("SERVER:SetWantedFlash", (flash) => {
|
||||
browser.execute(`setFlashing(${flash});`);
|
||||
});
|
||||
}
|
||||
@@ -26,10 +26,9 @@ export default function itemShopList(globalData: IGlobalData) {
|
||||
function addItems(data) {
|
||||
|
||||
// Fill it
|
||||
|
||||
for (const item of data) {
|
||||
|
||||
const tempItem = new UIMenuItem(item.Name, "");
|
||||
const tempItem = new UIMenuItem(item.Name, item.Description);
|
||||
|
||||
tempItem.SetRightLabel(`${item.Price > 0 ? `$${item.Price}` : "FREE"}`);
|
||||
|
||||
@@ -70,6 +69,8 @@ export default function itemShopList(globalData: IGlobalData) {
|
||||
// Reset some variables
|
||||
currentMenuIdx = -1;
|
||||
menuTransition = false;
|
||||
items = [];
|
||||
|
||||
|
||||
|
||||
// Create a new main menu
|
||||
@@ -84,6 +85,7 @@ export default function itemShopList(globalData: IGlobalData) {
|
||||
// Main menu events
|
||||
mainMenu.ItemSelect.on((selectedItem, itemIndex) => {
|
||||
const nextItem = items[itemIndex];
|
||||
mp.console.logInfo(JSON.stringify(items));
|
||||
mp.events.callRemote("SERVER:BuyItems", nextItem.Name);
|
||||
|
||||
});
|
||||
|
||||
@@ -137,9 +137,11 @@ export default function bankMenuHandle(globalData: IGlobalData) {
|
||||
|
||||
|
||||
mp.events.add('removeFactionBankmenu', () => {
|
||||
mp.gui.cursor.show(false, false);
|
||||
factionBankmenu.Close(true);
|
||||
globalData.InMenu = false;
|
||||
if (globalData.InMenu && factionBankmenu) {
|
||||
mp.gui.cursor.show(false, false);
|
||||
factionBankmenu.Close(true);
|
||||
globalData.InMenu = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
45
ReallifeGamemode.Client/Player/antiafk.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
export default function antiAfk(globalData: IGlobalData) {
|
||||
let lastPosition: Vector3Mp = mp.players.local.position;
|
||||
let afkCounter: number = 0;
|
||||
|
||||
let afkStatus: boolean = false;
|
||||
|
||||
setInterval(checkAfkPosition, 1000 * 10);
|
||||
|
||||
function checkAfkPosition() {
|
||||
|
||||
if (!globalData.LoggedIn) {
|
||||
return;
|
||||
}
|
||||
|
||||
let lp = lastPosition;
|
||||
let np = mp.players.local.position;
|
||||
|
||||
let distance = mp.game.gameplay.getDistanceBetweenCoords(lp.x, lp.y, lp.z, np.x, np.y, np.z, false);
|
||||
|
||||
if (distance <= 5) {
|
||||
if (!afkStatus) {
|
||||
afkCounter++;
|
||||
}
|
||||
} else {
|
||||
afkCounter = 0;
|
||||
if (afkStatus) {
|
||||
afkStatus = false;
|
||||
globalData.IsAfk = afkStatus;
|
||||
setServerAfkStatus(afkStatus);
|
||||
}
|
||||
}
|
||||
|
||||
if (afkCounter >= 30) {
|
||||
afkStatus = true;
|
||||
globalData.IsAfk = afkStatus;
|
||||
setServerAfkStatus(afkStatus);
|
||||
}
|
||||
|
||||
lastPosition = np;
|
||||
}
|
||||
|
||||
function setServerAfkStatus(status: boolean) {
|
||||
mp.events.callRemote("CLIENT:SetAfkStatus", status);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
LCtrl: 17,
|
||||
Shift: 16
|
||||
};
|
||||
mp.game.graphics.notify('~r~NoClip ~w~by ~b~Morbo');
|
||||
//mp.game.graphics.notify('~r~NoClip ~w~by ~b~Morbo');
|
||||
var isNoClip = false;
|
||||
var noClipCamera;
|
||||
var shiftModifier = false;
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
-2084633992,
|
||||
-1075685676,
|
||||
-1786099057,
|
||||
-1074790547
|
||||
-1074790547,
|
||||
-1569615261
|
||||
]
|
||||
|
||||
mp.events.add("playerJoin", () => {
|
||||
@@ -152,7 +153,6 @@
|
||||
checkWeaponhash() {
|
||||
let h = this.weapon;
|
||||
if (allowedWeaponHashes.indexOf(h) === -1) {
|
||||
mp.gui.chat.push("unallowed weapon: " + h);
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -189,12 +189,12 @@
|
||||
let Difference = Behaviour.subtractVector(Behaviour.pos, mp.players.local.position)
|
||||
if (Math.abs(Difference.x) > 30 || Math.abs(Difference.y) > 30) {
|
||||
if (Behaviour.isWalking()) {
|
||||
mp.events.callRemote("CLIENT:CheatDetection", "Flyhack/Teleport")
|
||||
//mp.events.callRemote("CLIENT:CheatDetection", "Flyhack/Teleport")
|
||||
}
|
||||
}
|
||||
if (mp.players.local.vehicle) {
|
||||
if (Behaviour.checkCarPos(25)) {
|
||||
mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Flyhack")
|
||||
//mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Flyhack")
|
||||
}
|
||||
if (Behaviour.VehicleFasterThan(250)) {
|
||||
mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Speedhack")
|
||||
|
||||
1348
ReallifeGamemode.Client/assets/chat/fonts/emoji_unicode.php
Normal file
@@ -1,14 +1,14 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="style/checkbox.css" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="style/main.css" media="screen">
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="chat" class="ui_element">
|
||||
<ul id="chat_messages"></ul>
|
||||
</div>
|
||||
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
</body>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="style/checkbox.css" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="style/main.css" media="screen">
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="chat" class="ui_element">
|
||||
<ul id="chat_messages"></ul>
|
||||
</div>
|
||||
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
3340
ReallifeGamemode.Client/assets/chat/jquery-1.11.3.min.js
vendored
@@ -1,36 +1,31 @@
|
||||
let chat =
|
||||
let chat =
|
||||
{
|
||||
size: 0,
|
||||
history_limit: 50,
|
||||
container: null,
|
||||
input: null,
|
||||
enabled: false,
|
||||
active: true,
|
||||
historyMsgs: [],
|
||||
currentIndex: 0
|
||||
size: 0,
|
||||
history_limit: 50,
|
||||
container: null,
|
||||
input: null,
|
||||
enabled: false,
|
||||
active: true,
|
||||
historyMsgs: [],
|
||||
currentIndex: 0
|
||||
};
|
||||
|
||||
const MAX_MSG_HISTORY = 12;
|
||||
|
||||
function enableChatInput(enable)
|
||||
{
|
||||
if(chat.active == false
|
||||
&& enable == true)
|
||||
return;
|
||||
|
||||
if (enable != (chat.input != null))
|
||||
{
|
||||
function enableChatInput(enable) {
|
||||
if (chat.active == false
|
||||
&& enable == true)
|
||||
return;
|
||||
|
||||
if (enable != (chat.input != null)) {
|
||||
mp.invoke("focus", enable);
|
||||
|
||||
if (enable)
|
||||
{
|
||||
if (enable) {
|
||||
chat.input = $("#chat").append('<div><input id="chat_msg" type="text" /></div>').children(":last");
|
||||
chat.input.children("input").focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
chat.input.fadeOut('fast', function()
|
||||
{
|
||||
chat.input.children("input").focus();
|
||||
}
|
||||
else {
|
||||
chat.input.fadeOut('fast', function () {
|
||||
chat.input.remove();
|
||||
chat.input = null;
|
||||
});
|
||||
@@ -40,69 +35,73 @@ function enableChatInput(enable)
|
||||
|
||||
var chatAPI =
|
||||
{
|
||||
push: (text) =>
|
||||
{
|
||||
let colorPositions = [];
|
||||
let colors = [];
|
||||
let chatElement = "<li>";
|
||||
push: (text) => {
|
||||
let colorPositions = [];
|
||||
let colors = [];
|
||||
let chatElement = "<li>";
|
||||
|
||||
for (let i = 0; i<text.length; i++) {
|
||||
let colorCheck = `${text[i]}${text[i+ 1]}${text[i + 2]}`;
|
||||
|
||||
if (colorCheck === "!{#") {
|
||||
colorPositions.push(i);
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
let colorCheck = `${text[i]}${text[i + 1]}${text[i + 2]}`;
|
||||
|
||||
colorPositions.forEach(el => {
|
||||
let sub = text.slice(el, -1);
|
||||
colors.push(sub.slice(3, 9));
|
||||
});
|
||||
if (colorCheck === "!{#") {
|
||||
colorPositions.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
colorPositions.forEach((el, i) => {
|
||||
let sub = text.slice(colorPositions[i] + 10, colorPositions[i + 1]);
|
||||
chatElement += `<span style='color: ${colors[i]}'>${sub}</span>`;
|
||||
});
|
||||
colorPositions.forEach(el => {
|
||||
let sub = text.slice(el, -1);
|
||||
colors.push(sub.slice(3, 9));
|
||||
});
|
||||
|
||||
chatElement += "</li>";
|
||||
colorPositions.forEach((el, i) => {
|
||||
let sub = text.slice(colorPositions[i] + 10, colorPositions[i + 1]);
|
||||
chatElement += `<span style='color: ${colors[i]}'>${sub}</span>`;
|
||||
});
|
||||
|
||||
if (chatElement === "<li></li>") {
|
||||
chat.container.prepend("<li>" + text + "</li>");
|
||||
} else {
|
||||
chat.container.prepend(chatElement);
|
||||
}
|
||||
var elmnt = document.getElementById("chat_messages");
|
||||
|
||||
chat.size++;
|
||||
chatElement += "</li>";
|
||||
|
||||
if (chat.size >= chat.history_limit)
|
||||
{
|
||||
chat.container.children(":last").remove();
|
||||
}
|
||||
},
|
||||
|
||||
clear: () =>
|
||||
{
|
||||
chat.container.html("");
|
||||
},
|
||||
|
||||
activate: (toggle) =>
|
||||
{
|
||||
if (toggle == false
|
||||
&& (chat.input != null))
|
||||
enableChatInput(false);
|
||||
|
||||
chat.active = toggle;
|
||||
},
|
||||
|
||||
show: (toggle) =>
|
||||
{
|
||||
if(toggle)
|
||||
$("#chat").show();
|
||||
else
|
||||
$("#chat").hide();
|
||||
|
||||
chat.active = toggle;
|
||||
}
|
||||
var today = new Date();
|
||||
|
||||
if (chatElement === "<li></li>") {
|
||||
if (chat.input == null || elmnt.scrollTop == elmnt.scrollHeight - elmnt.clientHeight) {
|
||||
chat.container.append("<li>" + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "</li>");
|
||||
elmnt.scrollTop = elmnt.scrollHeight - elmnt.clientHeight;
|
||||
} else {
|
||||
chat.container.append("<li>" + "[" + today.toLocaleTimeString('de-DE') + "] " + text + "</li>");
|
||||
}
|
||||
} else {
|
||||
chat.container.append(chatElement);
|
||||
}
|
||||
|
||||
chat.size++;
|
||||
|
||||
if (chat.size >= chat.history_limit) {
|
||||
chat.container.children(":first").remove();
|
||||
}
|
||||
},
|
||||
|
||||
clear: () => {
|
||||
chat.container.html("");
|
||||
},
|
||||
|
||||
activate: (toggle) => {
|
||||
if (toggle == false
|
||||
&& (chat.input != null))
|
||||
enableChatInput(false);
|
||||
|
||||
chat.active = toggle;
|
||||
},
|
||||
|
||||
show: (toggle) => {
|
||||
if (toggle)
|
||||
$("#chat").show();
|
||||
else
|
||||
$("#chat").hide();
|
||||
|
||||
chat.active = toggle;
|
||||
}
|
||||
};
|
||||
|
||||
let api = { "chat:push": chatAPI.push, "chat:clear": chatAPI.clear, "chat:activate": chatAPI.activate, "chat:show": chatAPI.show };
|
||||
@@ -111,81 +110,75 @@ for (let fn in api) {
|
||||
mp.events.add(fn, api[fn]);
|
||||
}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
chat.container = $("#chat ul#chat_messages");
|
||||
|
||||
$(document).ready(function () {
|
||||
chat.container = $("#chat ul#chat_messages");
|
||||
|
||||
$(".ui_element").show();
|
||||
chatAPI.push("Multiplayer started");
|
||||
|
||||
$("body").keyup(function(event)
|
||||
{
|
||||
$("body").keyup(function (event) {
|
||||
if (event.which == 84 && chat.input == null
|
||||
&& chat.active == true)
|
||||
{
|
||||
chat.currentIndex = 0;
|
||||
&& chat.active == true) {
|
||||
chat.currentIndex = 0;
|
||||
enableChatInput(true);
|
||||
event.preventDefault();
|
||||
event.preventDefault();
|
||||
} else if (event.which == 38) {
|
||||
if (chat.historyMsgs.length === 0)
|
||||
return;
|
||||
if (chat.historyMsgs.length === 0)
|
||||
return;
|
||||
|
||||
const previousMessages = chat.historyMsgs;
|
||||
const previousMessages = chat.historyMsgs;
|
||||
|
||||
if (previousMessages.length === chat.currentIndex)
|
||||
return;
|
||||
if (previousMessages.length === chat.currentIndex)
|
||||
return;
|
||||
|
||||
chat.input.children("input").val(previousMessages[chat.currentIndex]);
|
||||
|
||||
chat.input.children("input").val(previousMessages[chat.currentIndex]);
|
||||
|
||||
setTimeout(() => {
|
||||
chat.input.children("input").setSelectionRange(previousMessages[chat.currentIndex].length, previousMessages[chat.currentIndex].length);
|
||||
setTimeout(() => {
|
||||
chat.input.children("input").setSelectionRange(previousMessages[chat.currentIndex].length, previousMessages[chat.currentIndex].length);
|
||||
}, 1);
|
||||
|
||||
chat.currentIndex = chat.currentIndex + 1;
|
||||
} else if (event.which == 40) {
|
||||
if (chat.historyMsgs.length === 0)
|
||||
return;
|
||||
|
||||
|
||||
} else if (event.which == 40) {
|
||||
if (chat.historyMsgs.length === 0)
|
||||
return;
|
||||
const previousMessages = chat.historyMsgs;
|
||||
|
||||
const previousMessages = chat.historyMsgs;
|
||||
if (chat.currentIndex === -1) {
|
||||
chat.input.children("input").val("")
|
||||
return;
|
||||
}
|
||||
|
||||
if (chat.currentIndex === -1) {
|
||||
chat.input.children("input").val("")
|
||||
return;
|
||||
}
|
||||
chat.currentIndex = chat.currentIndex - 1;
|
||||
chat.input.children("input").val(previousMessages[chat.currentIndex]);
|
||||
|
||||
chat.currentIndex = chat.currentIndex - 1;
|
||||
chat.input.children("input").val(previousMessages[chat.currentIndex]);
|
||||
setTimeout(() => {
|
||||
chat.input.children("input").setSelectionRange(previousMessages[chat.currentIndex].length, previousMessages[chat.currentIndex].length);
|
||||
}, 1);
|
||||
}
|
||||
else if (event.which == 13 && chat.input != null) {
|
||||
var value = chat.input.children("input").val();
|
||||
|
||||
setTimeout(() => {
|
||||
chat.input.children("input").setSelectionRange(previousMessages[chat.currentIndex].length, previousMessages[chat.currentIndex].length);
|
||||
}, 1);
|
||||
}
|
||||
else if (event.which == 13 && chat.input != null)
|
||||
{
|
||||
var value = chat.input.children("input").val();
|
||||
if (value.length > 0) {
|
||||
if (chat.historyMsgs.length >= MAX_MSG_HISTORY) {
|
||||
chat.historyMsgs.pop();
|
||||
}
|
||||
|
||||
if (value.length > 0)
|
||||
{
|
||||
if (chat.historyMsgs.length >= MAX_MSG_HISTORY) {
|
||||
chat.historyMsgs.pop();
|
||||
}
|
||||
chat.historyMsgs.unshift(value);
|
||||
chat.currentIndex = 0;
|
||||
var elmnt = document.getElementById("chat_messages");
|
||||
|
||||
chat.historyMsgs.unshift(value);
|
||||
chat.currentIndex = 0;
|
||||
|
||||
if (value[0] == "/")
|
||||
{
|
||||
if (value[0] == "/") {
|
||||
value = value.substr(1);
|
||||
|
||||
if (value.length > 0)
|
||||
mp.invoke("command", value);
|
||||
elmnt.scrollTop = elmnt.scrollHeight - elmnt.clientHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
mp.invoke("chatMessage", value);
|
||||
|
||||
elmnt.scrollTop = elmnt.scrollHeight - elmnt.clientHeight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1277
ReallifeGamemode.Client/assets/chat/js/newMain.js
Normal file
@@ -1,68 +1,89 @@
|
||||
*,body,html{
|
||||
padding:0;
|
||||
margin:0}
|
||||
#chat,a,body,html{
|
||||
color:#fff
|
||||
*, body, html {
|
||||
padding: 0;
|
||||
margin: 0
|
||||
}
|
||||
body,html{
|
||||
-webkit-font-smoothing:antialiased;
|
||||
overflow:hidden;
|
||||
font-size:14px;
|
||||
-webkit-user-select:none
|
||||
}
|
||||
a{
|
||||
text-decoration:none
|
||||
}
|
||||
.ui_element{
|
||||
display:none;position:absolute;
|
||||
width:100vw;height:100vh;z-index:2
|
||||
}
|
||||
#chat{
|
||||
display:block;
|
||||
z-index:0;
|
||||
line-height:24px;
|
||||
font-weight:700;
|
||||
text-shadow:1px 1px 0 #000,-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000;
|
||||
font-family:Myriad Pro,Segoe UI,Verdana,sans-serif;
|
||||
font-size:16px;
|
||||
letter-spacing:.4px;
|
||||
margin-left:15px
|
||||
|
||||
#chat, a, body, html {
|
||||
color: #fff
|
||||
}
|
||||
@media screen and (min-height:1080px){
|
||||
|
||||
#chat{
|
||||
font-size:18px!important;
|
||||
font-weight:700}}
|
||||
#chat ul#chat_messages{
|
||||
overflow-y:auto;
|
||||
height:285px;
|
||||
margin-top:2vh; /*2vh*/
|
||||
transform:rotate(180deg);
|
||||
|
||||
body, html {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
overflow: hidden;
|
||||
font-size: 14px;
|
||||
-webkit-user-select: none
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
.ui_element {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: 2
|
||||
}
|
||||
|
||||
#chat {
|
||||
display: block;
|
||||
z-index: 0;
|
||||
line-height: 24px;
|
||||
font-weight: 700;
|
||||
text-shadow: 1px 1px 0 #000,-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000;
|
||||
font-family: Myriad Pro,Segoe UI,Verdana,sans-serif;
|
||||
font-size: 16px;
|
||||
letter-spacing: .4px;
|
||||
margin-left: 15px
|
||||
}
|
||||
|
||||
@media screen and (min-height:1080px) {
|
||||
#chat {
|
||||
font-size: 14px !important;
|
||||
font-weight: 700
|
||||
}
|
||||
}
|
||||
|
||||
#chat ul#chat_messages {
|
||||
direction: ltr;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: 285px;
|
||||
margin-top: 2vh; /*2vh*/
|
||||
transform: rotate(0deg);
|
||||
/*width:37vw; /* old: 37vw*/
|
||||
width: 800px;
|
||||
padding:10px 20px; /* old padding: 10px 20px*/
|
||||
list-style-type:none}
|
||||
#chat ul#chat_messages>li{
|
||||
transform:rotate(-180deg)}
|
||||
#chat input#chat_msg{
|
||||
color:#fff;
|
||||
background:rgba(0,0,0,.5);
|
||||
outline:0;border:none;
|
||||
font-family:Myriad Pro,Open Sans,sans-serif;
|
||||
font-size:13px;
|
||||
line-height:35px;
|
||||
width:35vw;
|
||||
padding:5px 5px 5px 15px}
|
||||
::-webkit-scrollbar{
|
||||
width:11px;
|
||||
max-width: 85%;
|
||||
padding: 10px 20px; /* old padding: 10px 20px*/
|
||||
list-style-type: none
|
||||
}
|
||||
::-webkit-scrollbar-thumb{
|
||||
background:rgba(255, 17, 0, 0.3);
|
||||
border-radius:20px
|
||||
|
||||
#chat ul#chat_messages > li {
|
||||
transform: rotate(0deg)
|
||||
}
|
||||
|
||||
#chat input#chat_msg {
|
||||
color: #fff;
|
||||
background: rgba(0,0,0,.5);
|
||||
outline: 0;
|
||||
border: none;
|
||||
font-family: Myriad Pro,Open Sans,sans-serif;
|
||||
font-size: 18px;
|
||||
line-height: 35px;
|
||||
width: 35vw;
|
||||
padding: 5px 5px 5px 15px
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover{
|
||||
background: rgba(255, 17, 0, 0.65)
|
||||
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 11px;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 17, 0, 0);
|
||||
border-radius: 20px
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 17, 0, 0)
|
||||
}
|
||||
@@ -14,9 +14,7 @@
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
div {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
width: 100%;
|
||||
@@ -618,8 +616,8 @@ t#tf_nameorid {
|
||||
display: inline-block;
|
||||
font-size: 0.5vw;
|
||||
position: relative;
|
||||
left: 7.7vw;
|
||||
top: 1vw;
|
||||
left: -7vw;
|
||||
top: 5vw;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@@ -633,8 +631,8 @@ t#tf_nameorid {
|
||||
display: inline-block;
|
||||
font-size: 0.5vw;
|
||||
position: relative;
|
||||
left: 12.5vw;
|
||||
top: -0.3vw;
|
||||
left: 5.5vw;
|
||||
top: -0.1vw;
|
||||
color: #ffffff;
|
||||
transition: 0.3s;
|
||||
}
|
||||
@@ -653,7 +651,7 @@ t#tf_nameorid {
|
||||
display: inline-block;
|
||||
font-size: 0.5vw;
|
||||
position: relative;
|
||||
left: -5.4vw;
|
||||
left: 5.7vw;
|
||||
top: 6vw;
|
||||
color: #ffffff;
|
||||
transition: 0.3s;
|
||||
|
||||
|
After Width: | Height: | Size: 7.0 KiB |
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 55.108 55.108" style="enable-background:new 0 0 55.108 55.108;" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path style="fill:#FBD490;" d="M23.554,29.603c0-1.915,0.301-3.584,0.817-5.043c-0.492-1.279-0.817-2.179-0.817-2.442
|
||||
c0-9.858-7.93-13.269-12.625-14.425c-0.194-0.048-0.375,0.104-0.375,0.304v27.652c3.706,1.14,7.525,1.782,11.358,1.924
|
||||
C22.906,35.545,23.554,32.958,23.554,29.603z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path style="fill:#F4C076;" d="M28.486,18.818c-0.201-1.172-0.907-2.169-1.888-2.758c0.588-0.696,0.956-1.584,0.956-2.566
|
||||
c0-0.509-0.104-0.991-0.277-1.438c0.471,0.049,0.925-0.215,1.021-0.701c0.062-0.312,0.157-0.613,0.255-0.876
|
||||
c0.257-0.684,1.178-0.778,1.596-0.179c0.016,0.023,0.032,0.046,0.047,0.07c0.123,0.184,0.3,0.284,0.49,0.342
|
||||
c-0.021-0.601,0.101-1.113,0.271-1.508c0.275-0.642,1.131-0.74,1.573-0.199c0.071,0.087,0.139,0.177,0.205,0.27
|
||||
c0.465,0.658,1.395,0.662,1.89,0.026c0.252-0.323,0.53-0.556,0.759-0.691c-2.05-3.927-6.585-6.007-11.83-6.007
|
||||
c-1.301,0-2.557-0.046-3.743-0.078c0.047,0.166,0.089,0.337,0.12,0.514c0.099,0.574,0.699,0.882,1.251,0.696
|
||||
c0.441-0.148,0.921-0.178,1.341,0.094c0.082,0.053,0.13,0.152,0.121,0.249c-0.025,0.268-0.186,0.701-0.504,1.131
|
||||
c-0.48,0.648-0.228,1.542,0.531,1.814c0.107,0.038,0.213,0.08,0.315,0.125c0.639,0.281,0.774,1.132,0.229,1.569
|
||||
c-0.492,0.395-1.782,2.579-3.216,3.885c2.067,2.191,3.556,5.247,3.556,9.515c0,0.263,0.325,1.164,0.817,2.442
|
||||
c0.887-2.507,2.42-4.378,4.175-5.786C28.527,18.789,28.506,18.802,28.486,18.818z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path style="fill:#EEAF4B;" d="M36.554,35.648v-20.56c-4.632,1.065-13,4.389-13,14.515c0,3.357-0.649,5.943-1.645,7.969
|
||||
C26.837,37.756,31.789,37.114,36.554,35.648z"/>
|
||||
</g>
|
||||
<path style="fill:#659C35;" d="M10.93,7.692c2.662,0.656,6.362,2.04,9.069,4.91c1.434-1.306,2.724-3.49,3.216-3.885
|
||||
c0.545-0.437,0.41-1.288-0.229-1.569c-0.102-0.045-0.208-0.086-0.315-0.125c-0.759-0.272-1.011-1.167-0.531-1.814
|
||||
c0.319-0.43,0.48-0.863,0.504-1.131c0.009-0.098-0.039-0.196-0.121-0.249c-0.42-0.272-0.9-0.242-1.341-0.094
|
||||
c-0.552,0.185-1.152-0.123-1.251-0.696c-0.054-0.313-0.142-0.617-0.234-0.882c-0.24-0.689-1.159-0.807-1.591-0.218
|
||||
c-0.017,0.023-0.033,0.045-0.049,0.069c-0.127,0.18-0.307,0.276-0.498,0.33c0.036-0.6-0.074-1.115-0.234-1.514
|
||||
c-0.26-0.648-1.113-0.768-1.567-0.238c-0.073,0.085-0.143,0.174-0.211,0.265c-0.481,0.647-1.41,0.627-1.89-0.02
|
||||
c-0.319-0.43-0.686-0.71-0.935-0.812C12.629-0.018,12.522,0,12.447,0.063c-0.382,0.323-0.494,0.79-0.48,1.256
|
||||
c0.017,0.582-0.452,1.066-1.03,0.994c-0.315-0.04-0.632-0.044-0.912-0.033c-0.729,0.03-1.109,0.874-0.672,1.459
|
||||
c0.017,0.022,0.034,0.045,0.051,0.067c0.361,0.462,0.192,1.117-0.321,1.403C8.877,5.323,8.724,5.459,8.625,5.563
|
||||
C8.54,5.653,8.529,5.796,8.606,5.894c0.447,0.567,1.229,1.313,1.976,1.979C10.638,7.74,10.778,7.655,10.93,7.692z"/>
|
||||
<path style="fill:#A46F3E;" d="M23.554,9.495c-0.388,0-0.759,0.066-1.113,0.169c-0.632,0.859-1.504,2.083-2.443,2.938
|
||||
c-0.058-0.061-0.122-0.112-0.18-0.172c1.213,1.241,2.229,2.776,2.896,4.656c-0.113-0.316-0.224-0.634-0.356-0.931
|
||||
c0.631-0.416,1.384-0.661,2.196-0.661c0.748,0,1.439,0.218,2.037,0.575c0.592-0.698,0.963-1.589,0.963-2.575
|
||||
C27.554,11.285,25.763,9.495,23.554,9.495z"/>
|
||||
<path style="fill:#6A3311;" d="M23.947,23.434c0.199,0.03,0.399,0.061,0.607,0.061c0.094,0,0.181-0.021,0.274-0.028
|
||||
c0.898-1.941,2.194-3.462,3.658-4.649c-0.323-1.885-1.954-3.324-3.932-3.324c-0.812,0-1.565,0.245-2.196,0.661
|
||||
c0.741,1.667,1.196,3.628,1.196,5.962C23.554,22.294,23.703,22.762,23.947,23.434z"/>
|
||||
<g>
|
||||
<path style="fill:#A4E869;" d="M39.539,14.153c-0.096-0.106-0.246-0.246-0.449-0.366c-0.505-0.298-0.658-0.957-0.286-1.41
|
||||
c0.018-0.022,0.036-0.044,0.053-0.066c0.451-0.574,0.093-1.427-0.636-1.475c-0.28-0.018-0.596-0.021-0.913,0.01
|
||||
c-0.579,0.058-1.036-0.438-1.005-1.019c0.025-0.465-0.075-0.935-0.45-1.267c-0.073-0.065-0.181-0.085-0.272-0.05
|
||||
c-0.251,0.096-0.625,0.366-0.955,0.789c-0.496,0.635-1.425,0.632-1.89-0.026c-0.066-0.093-0.134-0.183-0.205-0.27
|
||||
c-0.441-0.541-1.297-0.443-1.573,0.199c-0.17,0.395-0.292,0.907-0.271,1.508c-0.19-0.058-0.367-0.158-0.49-0.342
|
||||
c-0.016-0.023-0.031-0.047-0.047-0.07c-0.418-0.599-1.339-0.504-1.596,0.179c-0.099,0.263-0.194,0.564-0.255,0.876
|
||||
c-0.096,0.486-0.551,0.75-1.021,0.701c0.173,0.448,0.277,0.93,0.277,1.438c0,0.982-0.368,1.87-0.956,2.566
|
||||
c0.98,0.588,1.687,1.586,1.888,2.758c2.639-2.138,5.8-3.209,8.068-3.73v1.291c0.212-0.052,0.428-0.109,0.629-0.153
|
||||
c0.152-0.034,0.291,0.055,0.343,0.19c0.763-0.647,1.563-1.374,2.024-1.931C39.629,14.389,39.622,14.246,39.539,14.153z"/>
|
||||
</g>
|
||||
<path style="fill:#FFFFFF;" d="M26.554,7.495c-1.654,0-3-1.346-3-3c0-0.553,0.447-1,1-1s1,0.447,1,1c0,0.552,0.448,1,1,1
|
||||
c0.553,0,1,0.447,1,1S27.107,7.495,26.554,7.495z"/>
|
||||
<path style="fill:#FFFFFF;" d="M27.554,9.495c-0.553,0-1-0.447-1-1s0.447-1,1-1c0.552,0,1-0.448,1-1c0-0.553,0.447-1,1-1
|
||||
s1,0.447,1,1C30.554,8.149,29.208,9.495,27.554,9.495z"/>
|
||||
<path style="fill:#E6E6E6;" d="M37.554,48.784c0,3.478-2.846,6.325-6.324,6.325H15.879c-3.478,0-6.324-2.846-6.324-6.324l0-12.85
|
||||
c0-0.391,0.369-0.667,0.745-0.56c8.116,2.312,18.394,2.312,26.51,0c0.376-0.107,0.745,0.169,0.745,0.56L37.554,48.784z"/>
|
||||
<path style="fill:#D2D5D7;" d="M37.554,49.221l8.982-3.527c0.023-0.017,0.023-0.042,0-0.059l-8.982-3.527V49.221z"/>
|
||||
<path style="fill:#FFFFFF;" d="M15.554,51.108c-0.553,0-1-0.447-1-1s0.447-1,1-1c9.757,0,18-4.121,18-9c0-0.553,0.447-1,1-1
|
||||
s1,0.447,1,1C35.554,46.276,26.769,51.108,15.554,51.108z"/>
|
||||
<path style="fill:#A5A5A5;" d="M43.536,39.108c0.023-0.017,0.023-0.042,0-0.059l-5.982-0.941v4l2.201,0.864L43.536,39.108z"/>
|
||||
<circle style="fill:#E0BB80;" cx="18.585" cy="27.969" r="2.031"/>
|
||||
<circle style="fill:#E0BB80;" cx="14.585" cy="14.969" r="2.031"/>
|
||||
<circle style="fill:#DC9628;" cx="32.523" cy="32.969" r="2.031"/>
|
||||
<circle style="fill:#DC9628;" cx="28.554" cy="24" r="2.031"/>
|
||||
<circle style="fill:#FBD490;" cx="22.867" cy="24.438" r="0.813"/>
|
||||
<circle style="fill:#DC9628;" cx="26.742" cy="31.188" r="0.813"/>
|
||||
<circle style="fill:#DC9628;" cx="33.742" cy="26.813" r="0.813"/>
|
||||
<circle style="fill:#DC9628;" cx="33.742" cy="18.813" r="0.813"/>
|
||||
<circle style="fill:#DC9628;" cx="27.367" cy="35.188" r="0.813"/>
|
||||
<circle style="fill:#C6A473;" cx="15.742" cy="33.188" r="0.813"/>
|
||||
<circle style="fill:#C6A473;" cx="20.367" cy="34.188" r="0.813"/>
|
||||
<circle style="fill:#C6A473;" cx="13.742" cy="22.813" r="0.813"/>
|
||||
<circle style="fill:#FBD490;" cx="18.367" cy="19.813" r="0.813"/>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
@@ -62,7 +62,7 @@
|
||||
<div name="vehClass" class="veh hidden">
|
||||
<div class="main">
|
||||
<div class="title">
|
||||
<div class="titlecount"><span id="count2">0</span> / 250 Kilogramm</div>
|
||||
<div class="titlecount"><span id="count2">0</span> / <span id="trunkSize">0</span> Kilogramm</div>
|
||||
<div class="titletext">Fahrzeug</div>
|
||||
</div>
|
||||
<div class="Betrag4" style="display: none;">
|
||||
@@ -193,9 +193,11 @@
|
||||
mp.trigger("CEF:callVehicleInventory");
|
||||
}
|
||||
|
||||
function setVehicleItems(jsonItemArr) {
|
||||
function setVehicleItems(jsonItemArr, trunkSize) {
|
||||
var parsedItemArr = JSON.parse(jsonItemArr)
|
||||
vehInv = [];
|
||||
$('#trunkSize').html(trunkSize / 1000);
|
||||
|
||||
for (var i = 0; i < parsedItemArr.length; i++) {
|
||||
var item = parsedItemArr[i];
|
||||
var newItem = { Name: item.Name, ID: item.ItemId, Amount: item.Amount, Category: 0 };
|
||||
@@ -463,7 +465,7 @@
|
||||
blueButtonImg.setAttribute("class", "blueImg");
|
||||
blueButton.appendChild(blueButtonImg);
|
||||
|
||||
var listLength = list.length;
|
||||
var listLength = list.getElementsByTagName("li").length;
|
||||
|
||||
var row = 1;
|
||||
|
||||
@@ -483,7 +485,7 @@
|
||||
row = 6;
|
||||
}
|
||||
|
||||
var Litem = document.createElement("div");
|
||||
var Litem = document.createElement("li");
|
||||
Litem.setAttribute("class", "item" + row);
|
||||
Litem.setAttribute("id", i);
|
||||
Litem.setAttribute("name", "List" + item.Category);
|
||||
@@ -505,7 +507,7 @@
|
||||
while (child) {
|
||||
e.removeChild(child);
|
||||
child = e.lastElementChild;
|
||||
} console.log(handelInv);
|
||||
}
|
||||
|
||||
for (var i = 0; i < vehInv.length; i++) {
|
||||
var item = vehInv[i];
|
||||
@@ -533,7 +535,7 @@
|
||||
blueButtonImg.setAttribute("class", "blueImg");
|
||||
blueButton.appendChild(blueButtonImg);
|
||||
|
||||
var listLength = list.length;
|
||||
var listLength = list.getElementsByTagName("li").length;
|
||||
|
||||
var row = 1;
|
||||
|
||||
|
||||
16
ReallifeGamemode.Client/assets/html/vehiclemenu/script.js
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
|
||||
function ad_row(id, name, faction, ping) {
|
||||
var table_id = "t1";
|
||||
var table = document.getElementById(table_id);
|
||||
var rows = table.getElementsByTagName('tr').length;
|
||||
var tr = table.insertRow(rows);
|
||||
var td1 = document.createElement('td');
|
||||
var td2 = document.createElement('td');
|
||||
var td3 = document.createElement('td');
|
||||
var td4 = document.createElement('td');
|
||||
var test = faction;
|
||||
td1.innerHTML = ''+driver;
|
||||
tr.appendChild(td1);
|
||||
}
|
||||
67
ReallifeGamemode.Client/assets/html/vehiclemenu/style.css
Normal file
@@ -0,0 +1,67 @@
|
||||
/* style.css für Tabliste */
|
||||
.greyFont {
|
||||
color: gray;
|
||||
font-size: 14px;
|
||||
width: 250px;
|
||||
}
|
||||
div {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-weight: 500;
|
||||
color: #222;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
margin:5px;
|
||||
padding: 5px;
|
||||
border: 1px solid #808080;
|
||||
width: 20.75em;
|
||||
}
|
||||
.TabWrapper {
|
||||
background: rgba(0,0,0,0.6);
|
||||
height: 600px;
|
||||
width: 600px;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
left: 32%;
|
||||
top: 10%;
|
||||
}
|
||||
th, td {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
width:10%;
|
||||
text-align: left;
|
||||
}
|
||||
.scroll {
|
||||
height: 600px;
|
||||
width: 600px;
|
||||
font-size: 12px;
|
||||
overflow: auto;
|
||||
}
|
||||
.force-overflow {
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
#style1::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
#style1::-webkit-scrollbar-thumb {
|
||||
background-color: #FF0040;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,60 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<title>Wanteds</title>
|
||||
|
||||
<style>
|
||||
@font-face { font-family: 'Pricedown'; src: url('package://assets/font/Pricedown.ttf'); }
|
||||
html, body { margin: 0; padding: 0; }
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<title>Wanteds</title>
|
||||
|
||||
#wanteds {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
top: 65px;
|
||||
right: 22px;
|
||||
user-select: none;
|
||||
}
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Pricedown';
|
||||
src: url('package://assets/font/Pricedown.ttf');
|
||||
}
|
||||
|
||||
#wanteds img {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-right: 5px;
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
filter: drop-shadow(0px 0px 1px #000000);
|
||||
-webkit-filter: drop-shadow(0px 0px 1px #000000);
|
||||
-moz-filter: drop-shadow(0px 0px 1px #000000);
|
||||
}
|
||||
#wanteds {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
top: 65px;
|
||||
right: 22px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#wanteds span {
|
||||
color: white;
|
||||
font-family: "Pricedown", sans-serif;
|
||||
font-size: 2.5em;
|
||||
line-height: 1;
|
||||
-webkit-text-stroke: 1px black;
|
||||
margin-top: -5px;
|
||||
}
|
||||
</style>
|
||||
#wanteds img {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-right: 5px;
|
||||
filter: drop-shadow(0px 0px 1px #000000);
|
||||
-webkit-filter: drop-shadow(0px 0px 1px #000000);
|
||||
-moz-filter: drop-shadow(0px 0px 1px #000000);
|
||||
}
|
||||
|
||||
#wanteds span {
|
||||
color: white;
|
||||
font-family: "Pricedown", sans-serif;
|
||||
font-size: 2.5em;
|
||||
line-height: 1;
|
||||
-webkit-text-stroke: 1px black;
|
||||
margin-top: -5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="wanteds" style="display: none;">
|
||||
<img src="package://assets/img/wanteds/star.svg"> <span id="wanted-count">10</span>
|
||||
</div>
|
||||
<div id="wanteds" style="display: none;">
|
||||
<img src="package://assets/img/wanteds/star.svg" id="wanted-star"> <span id="wanted-count">10</span>
|
||||
</div>
|
||||
|
||||
<script src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function setWanteds(count) {
|
||||
if (count === 0) {
|
||||
$("#wanteds").hide();
|
||||
} else {
|
||||
$("#wanteds").show();
|
||||
$("#wanted-count").text(count.toString());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function setWanteds(count) {
|
||||
if (count === 0) {
|
||||
$("#wanteds").hide();
|
||||
} else {
|
||||
$("#wanteds").show();
|
||||
$("#wanted-count").text(count.toString());
|
||||
}
|
||||
}
|
||||
|
||||
var flashInterval = null;
|
||||
|
||||
var previousFlashToggle = false;
|
||||
var firstToggle = true;
|
||||
|
||||
function setFlashing(flash) {
|
||||
if (previousFlashToggle == flash && !firstToggle) {
|
||||
return;
|
||||
}
|
||||
firstToggle = false;
|
||||
previousFlashToggle = flash;
|
||||
if (flash) {
|
||||
if (flashInterval) {
|
||||
clearInterval(flashInterval);
|
||||
}
|
||||
flashInterval = setInterval(flashWantedImage, 750);
|
||||
} else {
|
||||
clearInterval(flashInterval);
|
||||
$("#wanted-star").css('visibility', 'visible');
|
||||
}
|
||||
}
|
||||
|
||||
var flashStatus = false;
|
||||
|
||||
function flashWantedImage() {
|
||||
flashStatus = !flashStatus;
|
||||
if (flashStatus) {
|
||||
$("#wanted-star").css('visibility', 'visible');
|
||||
} else {
|
||||
$("#wanted-star").css('visibility', 'hidden');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
26
ReallifeGamemode.Client/assets/vehicle/application.js
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
let close = document.getElementById('close');
|
||||
|
||||
$(document).ready(function () {
|
||||
mp.trigger("CEF:VehicleLook_Loaded");
|
||||
});
|
||||
|
||||
function setDrivers(driversJson) {
|
||||
var drivers = JSON.parse(driversJson);
|
||||
var listTag = $("#drivers-list");
|
||||
drivers.forEach(driver => {
|
||||
var name = driver.Name;
|
||||
var dateTime = new Date(driver.Time);
|
||||
|
||||
var date = `${dateTime.getDay()}.${dateTime.getMonth()}.${dateTime.getFullYear()}`;
|
||||
var time = `${dateTime.getHours()}:${dateTime.getMinutes()}:${dateTime.getSeconds()}`;
|
||||
|
||||
var infoLine = `${name} am ${date} um ${time} Uhr`;
|
||||
var listItemTag = `<li>${infoLine}</li>`;
|
||||
listTag.append(listItemTag);
|
||||
});
|
||||
}
|
||||
|
||||
close.onclick = function closeWindow() {
|
||||
mp.trigger('removeLookMenu');
|
||||
}
|
||||
29
ReallifeGamemode.Client/assets/vehicle/lastPlayers.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Eingabe | Life of German</title>
|
||||
|
||||
<link rel="stylesheet" href="package://assets/css/Introduction/style.css" />
|
||||
<link rel="stylesheet" href="../../font/font-awesome/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="../../font/font-awesome/css/regular.min.css">
|
||||
<link rel="stylesheet" href="../../font/roboto-mono/include_500.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
<div class="input-main">
|
||||
<h1>Letze Fahrer</h1>
|
||||
</div>
|
||||
<div id="content" class="form" role="form">
|
||||
<ul id="drivers-list">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<a id="close" href="#"></a>
|
||||
</main>
|
||||
<script src="../js/jquery-3.3.1.min.js"></script>
|
||||
<script src="./application.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
67
ReallifeGamemode.Client/assets/vehicle/style.css
Normal file
@@ -0,0 +1,67 @@
|
||||
/* style.css für Tabliste */
|
||||
.greyFont {
|
||||
color: gray;
|
||||
font-size: 14px;
|
||||
width: 250px;
|
||||
}
|
||||
div {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-weight: 500;
|
||||
color: #222;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
margin:5px;
|
||||
padding: 5px;
|
||||
border: 1px solid #808080;
|
||||
width: 20.75em;
|
||||
}
|
||||
.TabWrapper {
|
||||
background: rgba(0,0,0,0.6);
|
||||
height: 600px;
|
||||
width: 600px;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
left: 32%;
|
||||
top: 10%;
|
||||
}
|
||||
th, td {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
width:10%;
|
||||
text-align: left;
|
||||
}
|
||||
.scroll {
|
||||
height: 600px;
|
||||
width: 600px;
|
||||
font-size: 12px;
|
||||
overflow: auto;
|
||||
}
|
||||
.force-overflow {
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
#style1::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
#style1::-webkit-scrollbar-thumb {
|
||||
background-color: #FF0040;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6c1a845cfe60c75b75dd72add91c3bb7e6890c4df6cb10649be3740416b34d17
|
||||
size 3076608
|
||||
3
ReallifeGamemode.Client/dlcpacks/fibpack/dlc.rpf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5e4f54ec27530515452c0ef05241bd26ba70d13451ac24eb799ff3c6b18f42ec
|
||||
size 98724352
|
||||
1
ReallifeGamemode.Client/global.d.ts
vendored
@@ -4,6 +4,7 @@
|
||||
InMenu: boolean,
|
||||
InChat: boolean,
|
||||
LoggedIn: boolean,
|
||||
IsAfk: boolean,
|
||||
}
|
||||
|
||||
declare type AccountData = {
|
||||
|
||||
@@ -14,6 +14,7 @@ let globalData: IGlobalData = {
|
||||
HideGui: false,
|
||||
InChat: false,
|
||||
LoggedIn: false,
|
||||
IsAfk: false,
|
||||
|
||||
get InMenu(): boolean {
|
||||
return inMenu;
|
||||
@@ -258,6 +259,9 @@ animationSync();
|
||||
import antiCheat from './admin/anticheat';
|
||||
antiCheat(globalData);
|
||||
|
||||
import antiAfk from './Player/antiafk';
|
||||
antiAfk(globalData);
|
||||
|
||||
import ammunation from './Interaction/ammunation/ammunation';
|
||||
ammunation(globalData);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
var offerItemArr;
|
||||
var tradeItemArr;
|
||||
var vehItemArr;
|
||||
var trunkSize;
|
||||
|
||||
var loaded = false;
|
||||
|
||||
@@ -36,18 +37,18 @@
|
||||
var tradeItemWeight;
|
||||
|
||||
mp.events.add('openInventory', () => {
|
||||
globalData.InMenu = true;
|
||||
mp.gui.cursor.show(true, true);
|
||||
itemArr = [];
|
||||
vehItemArr = [];
|
||||
invBrowser = mp.browsers.new('package://assets/html/inventory/inventory.html');
|
||||
globalData.InMenu = true;
|
||||
mp.gui.cursor.show(true, true);
|
||||
itemArr = [];
|
||||
vehItemArr = [];
|
||||
invBrowser = mp.browsers.new('package://assets/html/inventory/inventory.html');
|
||||
});
|
||||
mp.events.add('closeInventory', () => {
|
||||
invBrowser.destroy()
|
||||
invBrowser = null;
|
||||
globalData.InMenu = false;
|
||||
loaded = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
invBrowser.destroy()
|
||||
invBrowser = null;
|
||||
globalData.InMenu = false;
|
||||
loaded = false;
|
||||
mp.gui.cursor.show(false, false);
|
||||
return;
|
||||
});
|
||||
|
||||
@@ -60,18 +61,24 @@
|
||||
});
|
||||
|
||||
mp.events.addDataHandler("backpackItems", (entity: EntityMp, jsonItemArr) => {
|
||||
if (entity.handle != mp.players.local.handle) return;
|
||||
if (entity != mp.players.local) return;
|
||||
itemArr = JSON.parse(jsonItemArr);
|
||||
if (loaded)
|
||||
invBrowser.execute(`setBackpackItems('${JSON.stringify(itemArr)}',true)`);
|
||||
});
|
||||
|
||||
mp.events.addDataHandler("setVehicleTrunk", (entity: EntityMp, size) => {
|
||||
if (entity != mp.players.local) return;
|
||||
trunkSize = size;
|
||||
});
|
||||
|
||||
mp.events.addDataHandler("vehicleItems", (entity: EntityMp, jsonItemArr) => {
|
||||
if (entity != mp.players.local) return;
|
||||
vehItemArr = JSON.parse(jsonItemArr);
|
||||
|
||||
if (loaded)
|
||||
invBrowser.execute(`setVehicleItems('${JSON.stringify(vehItemArr)}')`);
|
||||
if (loaded) {
|
||||
invBrowser.execute(`setVehicleItems('${JSON.stringify(vehItemArr)}', '${trunkSize}')`);
|
||||
}
|
||||
});
|
||||
|
||||
mp.events.add("CEF:InventoryLoaded", () => {
|
||||
@@ -79,7 +86,7 @@
|
||||
if (vehItemArr.length != 0) {
|
||||
invBrowser.execute(`setVehicleItems('${JSON.stringify(vehItemArr)}')`);
|
||||
}
|
||||
|
||||
|
||||
//invBrowser.execute(`setTradeItems('${JSON.stringify(tradeItemArr)}')`);
|
||||
//invBrowser.execute(`setOfferItems('${JSON.stringify(offerItemArr)}')`);
|
||||
loaded = true;
|
||||
@@ -98,7 +105,7 @@
|
||||
});
|
||||
|
||||
mp.events.add("CEF:useItem", (type, amount, id) => {
|
||||
mp.events.callRemote("itemInteract", type, amount, id);
|
||||
mp.events.callRemote("itemInteract", type, amount, id);
|
||||
});
|
||||
|
||||
mp.events.add("removeItem", (id, amount) => {
|
||||
@@ -110,7 +117,7 @@
|
||||
mp.events.add("aproveUse", (amount, name) => {
|
||||
if (invBrowser !== null) {
|
||||
mp.game.audio.playSoundFrontend(1, "LOCAL_PLYR_CASH_COUNTER_COMPLETE", "DLC_HEISTS_GENERAL_FRONTEND_SOUNDS", true);
|
||||
invBrowser.execute(`alertGreen('${JSON.stringify(amount)}','${JSON.stringify(name)}')`);
|
||||
invBrowser.execute(`alertGreen('${JSON.stringify(amount)}','${JSON.stringify(name)}')`);
|
||||
mp.events.call("closeInventory");
|
||||
}
|
||||
});
|
||||
@@ -136,7 +143,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mp.events.add("CEF:acceptTrade", () => {
|
||||
if (invBrowser !== null) {
|
||||
mp.events.callRemote('acceptTrade');
|
||||
|
||||
21
ReallifeGamemode.Client/package-lock.json
generated
@@ -2471,6 +2471,27 @@
|
||||
"to-regex": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"neato-emoji-converter": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/neato-emoji-converter/-/neato-emoji-converter-1.1.2.tgz",
|
||||
"integrity": "sha512-w3cTUXmawqnD8hRFP2sptCrPoymsFO0epmVQzy3mrhvKZToAIZji3/Wa6H3WoVxL5jdimGFzvnq+LEFoEjybpg==",
|
||||
"requires": {
|
||||
"emoji-toolkit": "^5.0.5",
|
||||
"lodash.toarray": "^4.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"emoji-toolkit": {
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/emoji-toolkit/-/emoji-toolkit-5.0.5.tgz",
|
||||
"integrity": "sha512-I57/yzEll8mIczqUCv2DaBhF61eBKtOwUN/7bxFPjwtwoVB9FnkRoabQRLZS6+KeSZNscw0av8o/N7tfy59PUg=="
|
||||
},
|
||||
"lodash.toarray": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz",
|
||||
"integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE="
|
||||
}
|
||||
}
|
||||
},
|
||||
"neo-async": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"neato-emoji-converter": "^1.1.2",
|
||||
"ragemp-better-bindings": "^1.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,11 +133,13 @@ export default function animationSync() {
|
||||
mp.events.callRemote("CLIENT:ClearAnimationData", false);
|
||||
}
|
||||
|
||||
const blockInputControls = [12, 13, 14, 15, 22, 24, 25, 37, 261, 262];
|
||||
|
||||
mp.events.add("render", () => {
|
||||
if (blockInput) {
|
||||
mp.game.controls.disableControlAction(32, 25, true);
|
||||
mp.game.controls.disableControlAction(32, 24, true);
|
||||
mp.game.controls.disableControlAction(32, 22, true);
|
||||
blockInputControls.forEach((ctrl) => {
|
||||
mp.game.controls.disableControlAction(32, ctrl, true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -93,6 +93,11 @@
|
||||
meelemodifier = 0.1;
|
||||
modifier = 1;
|
||||
|
||||
break;
|
||||
case 0xEFE7E2DF: // Assault SMG
|
||||
meelemodifier = 1;
|
||||
modifier = 0.259
|
||||
|
||||
break;
|
||||
default:
|
||||
modifier = 1;
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
export default function door() {
|
||||
mp.events.add("CLIENT:SetDoorOpen", (door, lose, permanent) => {
|
||||
mp.players.local.vehicle.setDoorOpen(door, lose, permanent);
|
||||
var vehicle = mp.players.local.vehicle;
|
||||
if (vehicle && mp.vehicles.exists(vehicle)) {
|
||||
vehicle.setDoorOpen(door, lose, permanent);
|
||||
}
|
||||
});
|
||||
mp.events.add("CLIENT:SetDoorShut", (door, permanent) => {
|
||||
mp.players.local.vehicle.setDoorShut(door, permanent);
|
||||
var vehicle = mp.players.local.vehicle;
|
||||
if (vehicle && mp.vehicles.exists(vehicle)) {
|
||||
mp.players.local.vehicle.setDoorShut(door, permanent);
|
||||
}
|
||||
});
|
||||
mp.events.add("CLIENT:SetDoorShutDelayed", (door, permanent, time) => {
|
||||
setTimeout(function () {
|
||||
mp.players.local.vehicle.setDoorShut(door, permanent);
|
||||
var vehicle = mp.players.local.vehicle;
|
||||
if (vehicle && mp.vehicles.exists(vehicle)) {
|
||||
vehicle.setDoorShut(door, permanent);
|
||||
}
|
||||
}, time)
|
||||
});
|
||||
}
|
||||
@@ -26,7 +26,7 @@ namespace ReallifeGamemode.Server.Admin
|
||||
{
|
||||
if (!cheater.IsLoggedIn())
|
||||
{
|
||||
cheater.Kick();
|
||||
return;
|
||||
}
|
||||
|
||||
if(cheater.IsAdminDuty())
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
using GTANetworkAPI;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Finance;
|
||||
@@ -60,11 +61,14 @@ namespace ReallifeGamemode.Server.Bank
|
||||
{
|
||||
if (client.IsInVehicle || !client.IsLoggedIn() || client.GetUser().FactionId is null) return;
|
||||
|
||||
if (client.GetUser().FactionLeader == true)
|
||||
User user = client.GetUser();
|
||||
|
||||
if (user.FactionLeader == true)
|
||||
{
|
||||
client.TriggerEvent("showFactionBankMenuLeader", client.GetUser().Faction.BankAccount.Balance.ToString());
|
||||
client.TriggerEvent("showFactionBankMenuLeader", user.Faction.BankAccount.Balance.ToString());
|
||||
return;
|
||||
}
|
||||
client.TriggerEvent("showFactionBankMenu", client.GetUser().Faction.BankAccount.Balance.ToString());
|
||||
client.TriggerEvent("showFactionBankMenu", user.Faction.BankAccount.Balance.ToString());
|
||||
}
|
||||
|
||||
private static void EntityExitFactionBankColShape(ColShape colShape, Player client)
|
||||
|
||||
@@ -56,61 +56,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
NAPI.Player.PlayPlayerAnimation(player, (int)(AnimationFlags.Loop | AnimationFlags.AllowPlayerControl | AnimationFlags.Cancellable), animDict, animName);
|
||||
}
|
||||
|
||||
[Command("eat", "~m~Benutzung: ~s~/eat [Item]")]
|
||||
public void CmdAdminEat(Player player, string item)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
IItem iItem = InventoryManager.GetItemByName(item);
|
||||
|
||||
if (iItem == null)
|
||||
{
|
||||
ChatService.SendMessage(player, "Dieses Essen existiert nicht.");
|
||||
return;
|
||||
}
|
||||
|
||||
List<UserItem> itemList = player.GetUser().GetItems();
|
||||
UserItem eatItem = itemList.FirstOrDefault(i => i.ItemId == iItem.Id);
|
||||
|
||||
if (eatItem == null)
|
||||
{
|
||||
ChatService.SendMessage(player, "Du hast dieses Item nicht");
|
||||
return;
|
||||
}
|
||||
|
||||
if (iItem is IUsableItem usableItemObj)
|
||||
{
|
||||
usableItemObj.Use(eatItem);
|
||||
}
|
||||
}
|
||||
|
||||
[Command("myvehicles")]
|
||||
public void CmdAdminMyVehicles(Player player)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
ChatService.SendMessage(player, "Deine Fahrzeuge: ");
|
||||
|
||||
int userID = player.GetUser().Id;
|
||||
using (var loadData = new DatabaseContext())
|
||||
{
|
||||
foreach (UserVehicle v in loadData.UserVehicles)
|
||||
{
|
||||
if (v.UserId == userID)
|
||||
{
|
||||
ChatService.SendMessage(player, "~b~" + v.Model);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO
|
||||
[Command("fpay")]
|
||||
public void FPay(Player player, string receiver, int amount)
|
||||
@@ -232,7 +177,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
#region Support
|
||||
|
||||
[Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~IP~s~, ~g~deathlogs~s~, ~g~LC~s~]", GreedyArg = true)]
|
||||
[Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~IP~s~, ~g~deathlogs~s~, ~g~LC~s~, ~g~Connect~s~]", GreedyArg = true)]
|
||||
public void CmdTog(Player player, string typ, string option1 = null, string option2 = null)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
@@ -281,6 +226,19 @@ namespace ReallifeGamemode.Server.Commands
|
||||
player.SendNotification("~g~[Info]~w~ Leaderchat wird nun angezeigt.");
|
||||
}
|
||||
break;
|
||||
|
||||
case "connect":
|
||||
if (player.HasData("togconnect"))
|
||||
{
|
||||
player.ResetData("togconnect");
|
||||
player.SendNotification("~g~[Info]~w~ Connect-Logs werden nun ausgeblendet.");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SetData("togconnect", true);
|
||||
player.SendNotification("~g~[Info]~w~ Connect-Logs werden nun angezeigt.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +437,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
target.Kick();
|
||||
}, 2500);
|
||||
|
||||
ChatService.BroadcastAdmin("~y~SKICK: ~w~" + targetname + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason, AdminLevel.SUPPORTER);
|
||||
ChatService.BroadcastAdmin("~y~SKICK: ~w~" + target.Name + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason, AdminLevel.SUPPORTER);
|
||||
}
|
||||
|
||||
[Command("clearchat", "~m~Benutzung: ~s~/clearchat")]
|
||||
@@ -799,7 +757,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
target.Kick();
|
||||
}, 2500);
|
||||
|
||||
ChatService.Broadcast("~y~INFO: ~w~" + targetname + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason);
|
||||
ChatService.Broadcast("~y~INFO: ~w~" + target.Name + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason);
|
||||
}
|
||||
|
||||
[Command("warn", "~m~Benutzung: ~s~/warn [Player] [Grund]", GreedyArg = true)]
|
||||
@@ -829,13 +787,13 @@ namespace ReallifeGamemode.Server.Commands
|
||||
dbContext.SaveChanges();
|
||||
if (userwarn.warn >= 3)
|
||||
{
|
||||
ChatService.Broadcast("~y~INFO: Das war der 3. Warn - bitte bannen!");
|
||||
ChatService.BroadcastAdmin("~y~INFO: Das war der 3. Warn - bitte bannen!", AdminLevel.ADMIN);
|
||||
}
|
||||
}
|
||||
|
||||
ChatService.SendMessage(target, "~r~WARNINFO: ~w~Du wurdest von " + adminPlayername + " verwarnt: " + reason);
|
||||
|
||||
ChatService.Broadcast("~y~INFO: ~w~" + targetPlayername + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " verwarnt: " + reason);
|
||||
ChatService.BroadcastAdmin("~y~INFO: ~w~" + targetPlayername + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " verwarnt: " + reason, AdminLevel.ADMIN);
|
||||
}
|
||||
|
||||
[Command("ip", "~m~Benutzung: ~s~/ip [Spieler]")]
|
||||
@@ -1327,6 +1285,12 @@ namespace ReallifeGamemode.Server.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.GetData<bool>("isDead") == true)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Dieser Spieler ist tot. Nutze /arevive.");
|
||||
return;
|
||||
}
|
||||
|
||||
target.SafeSetHealth(hp);
|
||||
ChatService.SendMessage(target, "~b~Deine HP wurden von " + player.Name + " auf " + hp + " gesetzt.");
|
||||
ChatService.SendMessage(player, "~b~Du hast die HP von " + target.Name + " auf " + hp + " gesetzt.");
|
||||
@@ -1438,6 +1402,13 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
target.TriggerEvent("onPlayerRevived");
|
||||
target.SendNotification("Du wurdest von Admin ~y~" + player.Name + "~s~ wiederbelebt.");
|
||||
|
||||
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == player.Name);
|
||||
if (task != null)
|
||||
{
|
||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~Der Auftrag von " + target.Name + " wurde entfernt (Administrativ wiederbelebt)", new List<int>() { 2 });
|
||||
}
|
||||
|
||||
target.SetData("isDead", false);
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
@@ -2012,7 +1983,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
foreach (var managedPlayer in peopleInRange)
|
||||
{
|
||||
if (!managedPlayer.IsLoggedIn()) return;
|
||||
if (!managedPlayer.IsLoggedIn() || managedPlayer.GetData<bool>("isDead")) continue;
|
||||
managedPlayer.SafeSetHealth(hp);
|
||||
ChatService.SendMessage(managedPlayer, "~b~Admin " + player.Name + " hat im Radius von " + radius + " die HP auf " + hp + " gesetzt.");
|
||||
}
|
||||
@@ -2292,6 +2263,91 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
}
|
||||
|
||||
[Command("setshopitem", "~m~Benutzung: ~s~/setshopitem [Item ID]")]
|
||||
public void CmdAdminSetItemInShop(Player player, int itemId)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
IItem item = InventoryManager.GetItemById(itemId);
|
||||
if (item is null)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Item existiert nicht");
|
||||
return;
|
||||
}
|
||||
|
||||
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
|
||||
if (nearestItemShopPoint is null)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Du bist nicht an einem Item Shop");
|
||||
return;
|
||||
}
|
||||
|
||||
using var dbContext = new DatabaseContext();
|
||||
|
||||
if (dbContext.ShopItems.Where(i => i.ShopId == nearestItemShopPoint.itemShop.id && i.ItemId == item.Id).FirstOrDefault() != null)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Item ist bereits im Shop");
|
||||
return;
|
||||
}
|
||||
|
||||
ShopItem shopItem = new ShopItem
|
||||
{
|
||||
ShopId = nearestItemShopPoint.itemShop.id,
|
||||
ItemId = item.Id,
|
||||
Amount = 20,
|
||||
Price = item.Price
|
||||
};
|
||||
|
||||
dbContext.ShopItems.Add(shopItem);
|
||||
dbContext.SaveChanges();
|
||||
|
||||
nearestItemShopPoint.itemShop.LoadItems();
|
||||
}
|
||||
|
||||
[Command("rmshopitem", "~m~Benutzung: ~s~/rmshopitem [Item ID]")]
|
||||
public void CmdAdminRemoveItemInShop(Player player, int itemId)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
IItem item = InventoryManager.GetItemById(itemId);
|
||||
if (item is null)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Item existiert nicht");
|
||||
return;
|
||||
}
|
||||
|
||||
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
|
||||
if (nearestItemShopPoint is null)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Du bist nicht an einem Item Shop");
|
||||
return;
|
||||
}
|
||||
|
||||
using var dbContext = new DatabaseContext();
|
||||
|
||||
ShopItem shopItem = dbContext.ShopItems.Where(i => i.ShopId == nearestItemShopPoint.itemShop.id && i.ItemId == item.Id).FirstOrDefault();
|
||||
|
||||
if (shopItem is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dbContext.ShopItems.Remove(shopItem);
|
||||
dbContext.SaveChanges();
|
||||
|
||||
nearestItemShopPoint.itemShop.LoadItems();
|
||||
}
|
||||
|
||||
[Command("inventory", "~m~Benutzung: ~s~/inventory [Spieler]")]
|
||||
public void CmdAdminGiveItem(Player player, string targetname)
|
||||
{
|
||||
|
||||
@@ -234,18 +234,19 @@ namespace ReallifeGamemode.Server.Commands
|
||||
[Command("setweaponrank", "~m~Benutzung: ~s~/setweaponrank [Waffen Name] [Rank]")]
|
||||
public void CmdFactionWeaponRank(Player player, string weaponModel, int rank)
|
||||
{
|
||||
if (player.GetUser()?.FactionId == null || player.GetUser().FactionLeader == false)
|
||||
User user = player.GetUser();
|
||||
if (user == null || user.FactionId == null || user.FactionLeader == false)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (rank > 12 || rank < 1)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Gebe einen gültigen Rang ein");
|
||||
return;
|
||||
}
|
||||
|
||||
User user = player.GetUser();
|
||||
WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId);
|
||||
if (nearestWeapon == null)
|
||||
{
|
||||
@@ -355,15 +356,15 @@ namespace ReallifeGamemode.Server.Commands
|
||||
public void CmdFactionMedicHealive(Player player, string receiver, int price = 10)
|
||||
{
|
||||
Player target = PlayerService.GetPlayerByNameOrId(receiver);
|
||||
if (player.GetUser()?.FactionId != 2)
|
||||
if(target == null || !target.IsLoggedIn())
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
ChatService.PlayerNotFound(player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.Position.DistanceTo(target.Position) > 5)
|
||||
if (player.GetUser()?.FactionId != 2)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Der Patient ist zu weit entfernt");
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -390,6 +391,12 @@ namespace ReallifeGamemode.Server.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.Position.DistanceTo(target.Position) > 5)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Der Patient ist zu weit entfernt");
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.Health == 100)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Der Spieler ist bereits voll geheilt");
|
||||
@@ -407,6 +414,31 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
#region Staatsfraktionen (LSPD / FBI) Commands
|
||||
|
||||
[Command("m", "~m~Benutzung: ~s~/m [Message]")]
|
||||
public void CmdFactionMegaphone(Player player, String message)
|
||||
{
|
||||
User user = player.GetUser();
|
||||
if (user == null || (user.FactionId != 1 && user.FactionId != 3))
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.IsDuty())
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Du bist nicht im Dienst");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.IsInVehicle)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Du bist nicht in einem Fahrzeug");
|
||||
return;
|
||||
}
|
||||
|
||||
ChatService.SendInRange(player.Position, 50, "!{#FFFF00}[" + player.GetUser().Faction.Name + " " + player.Name + ": !{#FFFF00}" + message + "]");
|
||||
}
|
||||
|
||||
[Command("cuff", "~m~Benutzung: ~s~/cuff")]
|
||||
public void CmdFactionCuff(Player player)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GTANetworkAPI;
|
||||
using Newtonsoft.Json;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
@@ -16,6 +17,42 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
internal class UserCommands : Script
|
||||
{
|
||||
[Command("look", "~m~look")]
|
||||
public void CmdUserLook(Player player)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
|
||||
Vehicle veh = NAPI.Pools.GetAllVehicles()
|
||||
.Where(v => v.Position.DistanceTo(player.Position) <= 5)
|
||||
.OrderBy(v => v.Position.DistanceTo(player.Position))
|
||||
.FirstOrDefault();
|
||||
|
||||
if (veh == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var lastDriverDic = new Dictionary<string, DateTime>();
|
||||
|
||||
if(VehicleManager.lastDriversInVehicle.ContainsKey(veh))
|
||||
{
|
||||
lastDriverDic = VehicleManager.lastDriversInVehicle[veh];
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendNotification("~r~Mit diesem Fahrzeug ist noch niemand gefahren");
|
||||
return;
|
||||
}
|
||||
|
||||
var list = lastDriverDic.Select(v => new
|
||||
{
|
||||
Name = v.Key,
|
||||
Time = v.Value
|
||||
}).OrderByDescending(v => v.Time).ToList();
|
||||
|
||||
player.TriggerEvent("lookLastDrivers", JsonConvert.SerializeObject(list));
|
||||
}
|
||||
|
||||
[Command("id", "~m~Benutzung: ~s~/id [Name]")]
|
||||
public void CmdUserId(Player player, String targetname)
|
||||
{
|
||||
@@ -61,7 +98,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
pVeh = NAPI.Pools.GetAllVehicles().Where(v => v.Position.DistanceTo(player.Position) <= 5).FirstOrDefault();
|
||||
pVeh = NAPI.Pools.GetAllVehicles().Where(v => v.Position.DistanceTo(player.Position) <= 5).OrderBy(v => v.Position.DistanceTo(player.Position)).FirstOrDefault();
|
||||
}
|
||||
|
||||
if (pVeh == null)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
string serverMsg = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
||||
if (serverMsg.Trim().Length == 0) return;
|
||||
NAPI.Player.GetPlayersInRadiusOfPlayer(10, player).ForEach(p =>
|
||||
NAPI.Player.GetPlayersInRadiusOfPlayer(25, player).ForEach(p =>
|
||||
{
|
||||
ChatService.SendMessage(p, $"{player.Name} sagt: {serverMsg}");
|
||||
});
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
//player.SetSharedData("vehicleAdminSpeed2", 1.0);
|
||||
player.SetData("isLoggedIn", false);
|
||||
player.SafeTeleport(new Vector3(-1883.736, -781.4911, -10));
|
||||
player.Dimension = (uint)(player.Handle.Value + 1);
|
||||
|
||||
bool registered = false;
|
||||
|
||||
@@ -80,11 +81,16 @@ namespace ReallifeGamemode.Server.Events
|
||||
bool disableLightMode = currentTime > LightModeTimeFrom && currentTime < LightModeTimeTo;
|
||||
|
||||
player.TriggerEvent("SERVER:Login_ShowBrowser", registered, disableLightMode);
|
||||
string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")";
|
||||
if (player.HasData("togip"))
|
||||
{
|
||||
ChatService.SendMessage(player, msg);
|
||||
}
|
||||
string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "]";
|
||||
string ipMsg = " (" + player.Address + ")";
|
||||
ChatService.BroadcastAdmin(msg, AdminLevel.SUPPORTER, getAddInfoMessage: admin =>
|
||||
{
|
||||
return admin.HasData("togip") ? ipMsg : string.Empty;
|
||||
},
|
||||
shouldSendMessage: admin =>
|
||||
{
|
||||
return admin.HasData("togconnect");
|
||||
});
|
||||
}
|
||||
|
||||
private bool IsPlayerBanned(Player player)
|
||||
|
||||
@@ -94,6 +94,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
Medic.delHealTask(player);
|
||||
|
||||
if (user.JailTime <= 0)
|
||||
{
|
||||
user.Dead = true;
|
||||
@@ -113,7 +115,6 @@ namespace ReallifeGamemode.Server.Events
|
||||
MedicName = "none"
|
||||
};
|
||||
Medic.AddTaskToList(reviveTask);
|
||||
Medic.delHealTask(player);
|
||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " ist soeben verstorben.", new List<int>() { 2 });
|
||||
}
|
||||
|
||||
@@ -238,8 +239,12 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
player.RemoveAllWeapons();
|
||||
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == player.Name);
|
||||
Player medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
||||
Medic.RemoveTaskFromList(task);
|
||||
|
||||
if(task != null)
|
||||
{
|
||||
Player medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
||||
Medic.RemoveTaskFromList(task);
|
||||
}
|
||||
|
||||
player.SafeTeleport(new Vector3(-495.45, -336.33, 34.5), 0, true);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
using ReallifeGamemode.Server.Report;
|
||||
using ReallifeGamemode.Server.Factions.Medic;
|
||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
using ReallifeGamemode.Server.Inventory;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Event Login (Login.cs)
|
||||
@@ -30,6 +32,13 @@ namespace ReallifeGamemode.Server.Events
|
||||
public void OnPlayerDisconnected(Player player, DisconnectionType type, string reason)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
using var saveUser = new DatabaseContext();
|
||||
User user = player.GetUser(saveUser);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == DisconnectionType.Left)
|
||||
{
|
||||
@@ -41,7 +50,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
if (type == DisconnectionType.Timeout)
|
||||
{
|
||||
NAPI.Util.ConsoleOutput(player.Name + " Timeoutet");
|
||||
NAPI.Util.ConsoleOutput(player.Name + " timed out");
|
||||
}
|
||||
|
||||
/*if (GlobalHelper.DutyAdmins.Contains(player))
|
||||
@@ -49,10 +58,23 @@ namespace ReallifeGamemode.Server.Events
|
||||
GlobalHelper.DutyAdmins.Remove(player);
|
||||
}*/
|
||||
|
||||
if (player.GetUser().IsAdmin(AdminLevel.MAPPING))
|
||||
if (user.IsAdmin(AdminLevel.MAPPING))
|
||||
{
|
||||
ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING);
|
||||
}
|
||||
|
||||
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == player.Name);
|
||||
|
||||
if (task != null)
|
||||
{
|
||||
ChatService.BroadcastFaction("~y~[MEDIC] ~w~Info: Der Auftrag von " + player.Name + " wurde entfernt (Ausgeloggt)", new List<int>() { 2 });
|
||||
}
|
||||
|
||||
if (player.IsAdminDuty())
|
||||
{
|
||||
ChatService.Broadcast("!{#ee4d2e}[SUPPORT] " + player.Name + " hat sich vom Support abgemeldet (Ausgeloggt)");
|
||||
}
|
||||
|
||||
/*
|
||||
TaxiDriverJob taxiJob = JobManager.GetJob<TaxiDriverJob>();
|
||||
TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).FirstOrDefault();
|
||||
@@ -74,8 +96,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
Report.Report.listReports.Remove(temp);
|
||||
|
||||
Player user = PlayerService.GetPlayerByNameOrId(temp.getUser());
|
||||
user.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der Admin hat den Server verlassen");
|
||||
Player ticketUser = PlayerService.GetPlayerByNameOrId(temp.getUser());
|
||||
ticketUser.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der Admin hat den Server verlassen");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -124,27 +146,49 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
using (var saveUser = new DatabaseContext())
|
||||
List<UserItem> fItem = saveUser.UserItems.Where(u => u.UserId == user.Id).ToList();
|
||||
|
||||
foreach (var item in fItem)
|
||||
{
|
||||
var user = player.GetUser(saveUser);
|
||||
Vector3 pos = player.Position;
|
||||
|
||||
user.PositionX = pos.X;
|
||||
user.PositionY = pos.Y;
|
||||
user.PositionZ = pos.Z;
|
||||
saveUser.SaveChanges();
|
||||
user.Dead = player.HasData("isDead") ? (bool)player.GetData<bool>("isDead") : false;
|
||||
|
||||
if (user.Wanteds > 0)
|
||||
IItem iItem = InventoryManager.GetItemById(item.ItemId);
|
||||
if (iItem is IWeaponDealItem obj)
|
||||
{
|
||||
ChatService.HQMessage("Der Straftäter " + player.GetUser().Name + " ist vom Radar verschwunden");
|
||||
}
|
||||
int amount = item.Amount;
|
||||
|
||||
Vector3 dropPosition = PlayerExtension.GetPositionFromPlayer(player, 0.6f, 0);
|
||||
//new Vector3(player.Position.X, player.Position.Y, player.Position.Z - 0.8f);
|
||||
Random r = new Random();
|
||||
GTANetworkAPI.Object grndObject;
|
||||
Vector3 textPos = dropPosition;
|
||||
|
||||
dropPosition.Z -= 1.05f;
|
||||
grndObject = NAPI.Object.CreateObject(3666746839, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 255, 0);
|
||||
|
||||
GroundItem grndItem = new GroundItem { ItemId = iItem.Id, Amount = amount, Position = dropPosition };
|
||||
TextLabel grndTxtLbl = NAPI.TextLabel.CreateTextLabel(iItem.Name + " ~s~(~y~" + amount + "~s~)", textPos, 5, 0.5f, 4, new Color(255, 255, 255), false, 0);
|
||||
GroundItem.AddGroundItem(grndItem, grndObject, grndTxtLbl);
|
||||
|
||||
saveUser.Remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
Vector3 pos = player.Position;
|
||||
|
||||
user.PositionX = pos.X;
|
||||
user.PositionY = pos.Y;
|
||||
user.PositionZ = pos.Z;
|
||||
saveUser.SaveChanges();
|
||||
user.Dead = player.HasData("isDead") ? (bool)player.GetData<bool>("isDead") : false;
|
||||
|
||||
if (user.Wanteds > 0)
|
||||
{
|
||||
ChatService.HQMessage("Der Straftäter " + user.Name + " ist vom Radar verschwunden");
|
||||
}
|
||||
|
||||
player.SetData("isLoggedIn", false);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 1);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 2);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 3);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 3);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 4);
|
||||
|
||||
Medic.delHealTask(player);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.WeaponDeal;
|
||||
|
||||
@@ -20,6 +22,13 @@ namespace ReallifeGamemode.Server.Events
|
||||
if (vehicle.HasMarkerBehind())
|
||||
vehicle.RemoveMarkerBehind();
|
||||
|
||||
if (!VehicleManager.lastDriversInVehicle.ContainsKey(vehicle))
|
||||
{
|
||||
VehicleManager.lastDriversInVehicle.Add(vehicle, new Dictionary<string, DateTime>());
|
||||
}
|
||||
|
||||
VehicleManager.lastDriversInVehicle[vehicle][client.Name] = DateTime.Now;
|
||||
|
||||
if (vehicle.GetServerVehicle() is FactionVehicle veh)
|
||||
{
|
||||
User u = client.GetUser();
|
||||
|
||||
@@ -498,7 +498,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
List<string> stages = new List<string>();
|
||||
foreach (var e in PositionManager.ElevatorPoints)
|
||||
{
|
||||
if (e.Position.DistanceTo2D(player.Position) <= 25 && e.Position.DistanceTo(player.Position) > 1.5)
|
||||
if (e.Position.DistanceTo2D(player.Position) <= 30 && e.Position.DistanceTo(player.Position) > 1.5)
|
||||
{
|
||||
stages.Add(e.Stage);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.Wanted;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Event Login (Login.cs)
|
||||
@@ -105,11 +107,11 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
string addInfoStr = " (IP: " + player.Address + ")";
|
||||
|
||||
if(!string.IsNullOrEmpty(message))
|
||||
if (!string.IsNullOrEmpty(message))
|
||||
{
|
||||
ChatService.BroadcastAdmin(message, AdminLevel.MAPPING, admin =>
|
||||
{
|
||||
if(admin.HasData("togip"))
|
||||
if (admin.HasData("togip"))
|
||||
{
|
||||
return addInfoStr;
|
||||
}
|
||||
@@ -144,6 +146,21 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
Jail.Check_PutBehindBars(user);
|
||||
}
|
||||
|
||||
player.Dimension = 0;
|
||||
}
|
||||
|
||||
List<UserItem> fItem = dbContext.UserItems.Where(u => u.UserId == user.Id).ToList();
|
||||
foreach (var item in fItem)
|
||||
{
|
||||
IItem iItem = InventoryManager.GetItemById(item.ItemId);
|
||||
if (iItem is IWeaponDealItem obj)
|
||||
{
|
||||
player.SyncAnimation("carryBox");
|
||||
player.AddAttachment("ammobox", false);
|
||||
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
player.TriggerEvent("draw", player.Name, player.Handle.Value);
|
||||
@@ -168,7 +185,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}, delayTime: 1000);
|
||||
|
||||
if(GlobalHelper.CountdownUntil > DateTime.Now)
|
||||
if (GlobalHelper.CountdownUntil > DateTime.Now)
|
||||
{
|
||||
player.TriggerEvent("countdown", (GlobalHelper.CountdownUntil - DateTime.Now).TotalSeconds, GlobalHelper.CountdownText);
|
||||
}
|
||||
|
||||
@@ -13,5 +13,15 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
player.SafeTeleport(pos);
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:SetAfkStatus")]
|
||||
public void SetPlayerAfkStatus(Player player, bool status)
|
||||
{
|
||||
player.SetSharedData("isAfk", status);
|
||||
if(status)
|
||||
{
|
||||
player.SendNotification("Du wurdest ~b~AFK~s~ gesetzt", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,9 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
/// <returns></returns>
|
||||
public static User GetUser(this Player client, DatabaseContext context = null)
|
||||
{
|
||||
context = context ?? new DatabaseContext();
|
||||
if (!client.IsLoggedIn()) return null;
|
||||
|
||||
context = context ?? new DatabaseContext();
|
||||
return context
|
||||
.Users
|
||||
.Include(u => u.Faction)
|
||||
@@ -94,7 +95,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
return;
|
||||
}
|
||||
|
||||
int time = 26 * user.Wanteds;
|
||||
int time = 18 * user.Wanteds;
|
||||
if (killed)
|
||||
{
|
||||
time *= 2;
|
||||
@@ -135,6 +136,16 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
return player.GetServerData("duty", false);
|
||||
}
|
||||
|
||||
public static bool IsAfk(this Player player)
|
||||
{
|
||||
if(!player.HasSharedData("isAfk"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return player.GetSharedData<bool>("isAfk");
|
||||
}
|
||||
|
||||
public static bool IsAlive(this Player player)
|
||||
{
|
||||
return !player.HasData("isDead") || player.GetData<bool>("isDead") == false;
|
||||
@@ -328,6 +339,11 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
int nameTagColor = 0;
|
||||
|
||||
Player player = user.Player;
|
||||
if(player == null || !player.IsLoggedIn())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool duty = user.GetData<bool>("duty");
|
||||
|
||||
if (player.GetData<bool>("SAdminduty"))
|
||||
@@ -427,6 +443,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
return;
|
||||
|
||||
player.SyncAnimation("hup");
|
||||
NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed);
|
||||
|
||||
if (player.GetUser().Wanteds > 0)
|
||||
PositionManager.cuffPoints.Add(player);
|
||||
|
||||
@@ -17,5 +17,116 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
{
|
||||
return NAPI.Pools.GetAllPlayers().Where(p => p.Vehicle != null && p.Vehicle?.Handle == veh.Handle && p.VehicleSeat == 0).FirstOrDefault();
|
||||
}
|
||||
|
||||
//https://wiki.rage.mp/index.php?title=Vehicle_Classes
|
||||
public static int GetVehicleTrunkSize(this Vehicle vehicle)
|
||||
{
|
||||
switch (vehicle.Class)
|
||||
{
|
||||
case 0:
|
||||
return 100 * 1000;
|
||||
|
||||
case 1:
|
||||
return 180 * 1000;
|
||||
|
||||
case 2:
|
||||
return 400 * 1000;
|
||||
|
||||
case 3:
|
||||
return 210 * 1000;
|
||||
|
||||
case 4:
|
||||
if ((VehicleHash)vehicle.HashCode == VehicleHash.Moonbeam
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Moonbeam2
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Ratloader
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Ratloader2
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Slamvan
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Slamvan2
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Slamvan3
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Yosemite
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Yosemite2
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Picador
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Moonbeam)
|
||||
return 250 * 1000;
|
||||
else
|
||||
return 180 * 1000;
|
||||
|
||||
case 5:
|
||||
if ((VehicleHash)vehicle.HashCode == VehicleHash.Fagaloa
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Cheburek)
|
||||
return 200 * 1000;
|
||||
else
|
||||
return 110 * 1000;
|
||||
|
||||
case 6:
|
||||
return 120 * 1000;
|
||||
|
||||
case 7:
|
||||
return 80 * 1000;
|
||||
|
||||
case 8:
|
||||
return 5 * 1000;
|
||||
|
||||
case 9:
|
||||
if ((VehicleHash)vehicle.HashCode == VehicleHash.Bifta
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Blazer
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Blazer2
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Blazer3
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Blazer4
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Blazer5)
|
||||
return 30 * 1000;
|
||||
else
|
||||
return 300 * 1000;
|
||||
|
||||
case 10:
|
||||
return 2500 * 1000;
|
||||
|
||||
case 11:
|
||||
return 0;
|
||||
|
||||
case 12:
|
||||
if ((VehicleHash)vehicle.HashCode == VehicleHash.Minivan
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Minivan2
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Bobcatxl)
|
||||
return 600 * 1000;
|
||||
else
|
||||
return 1000 * 1000;
|
||||
|
||||
case 13:
|
||||
return 0;
|
||||
|
||||
case 14:
|
||||
return 50 * 1000;
|
||||
|
||||
case 15:
|
||||
return 0;
|
||||
|
||||
case 16:
|
||||
return 0;
|
||||
|
||||
case 17:
|
||||
return 0;
|
||||
|
||||
case 18:
|
||||
if ((VehicleHash)vehicle.HashCode == VehicleHash.Policet)
|
||||
return 1000 * 1000;
|
||||
else if ((VehicleHash)vehicle.HashCode == VehicleHash.Firetruk
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Pbus
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Policeb
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Polmav
|
||||
|| (VehicleHash)vehicle.HashCode == VehicleHash.Predator)
|
||||
return 0;
|
||||
else
|
||||
return 150 * 1000;
|
||||
|
||||
case 19:
|
||||
return 0;
|
||||
|
||||
case 20:
|
||||
return 2500 * 1000;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,6 +182,12 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
||||
{
|
||||
var medic = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
||||
var victim = PlayerService.GetPlayerByNameOrId(task.Victim);
|
||||
|
||||
if(medic == null || victim == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
task.Position = victim.Position;
|
||||
medic.TriggerEvent("updateHealCheckpoint", victim.Position.X, victim.Position.Y, victim.Position.Z);
|
||||
}
|
||||
@@ -257,7 +263,7 @@ namespace ReallifeGamemode.Server.Factions.Medic
|
||||
{
|
||||
player.SetData("healauftrag", false);
|
||||
var medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
||||
if (task.MedicName != "none")
|
||||
if (medicPlayer != null)
|
||||
{
|
||||
medicPlayer.TriggerEvent("destroyMedicTaskCheckpoint");
|
||||
}
|
||||
|
||||
@@ -189,6 +189,11 @@ namespace ReallifeGamemode.Server.Finance
|
||||
using var dbContext = new DatabaseContext();
|
||||
foreach (var player in NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn()))
|
||||
{
|
||||
if(player.IsAfk())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
User user = player.GetUser(dbContext);
|
||||
if(user == null)
|
||||
{
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction?.Name == this.Attacker).ToArray();
|
||||
|
||||
Faction ownerFaction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).FirstOrDefault();
|
||||
Faction attackerFaction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).FirstOrDefault();
|
||||
Faction attackerFaction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getAttacker()).FirstOrDefault();
|
||||
|
||||
if (ownerFaction == null || attackerFaction == null)
|
||||
{
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Interfaces
|
||||
{
|
||||
public interface IUsableItem : IItem, IDroppableItem
|
||||
public interface IUsableItem : IItem, IDroppableItem //marker Interface
|
||||
{
|
||||
void Use(UserItem uItem);
|
||||
bool Use(UserItem uItem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
public override string Description => "Ein Fisch";
|
||||
public override int Gewicht => 3600;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 20;
|
||||
public override uint Object => 786272259;
|
||||
public override int Price => 0;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class Apfel : FoodItem
|
||||
internal class Apfel : ConsumableItem
|
||||
{
|
||||
public override int Id => 101;
|
||||
public override string Name => "Apfel";
|
||||
public override string Description => "Ein Apfel";
|
||||
public override int Gewicht => 10;
|
||||
public override string Description => "Ein Apfel.";
|
||||
public override int Gewicht => 200;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 10;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 20;
|
||||
public override int Price => 200;
|
||||
public override float Cooldown => 10000;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
player.SafeSetHealth(player.Health + amountToAdd);
|
||||
player.SendNotification("Du hast einen ~y~" + Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,14 @@ using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class AssaultRifle : WeaponDealItem
|
||||
internal class AssaultRifle : WeaponDealItem
|
||||
{
|
||||
public override int Id => 13;
|
||||
public override string Name => "AssaultRifle";
|
||||
public override string Description => "Waffe";
|
||||
public override int Gewicht => 500;
|
||||
public override string Einheit => "g";
|
||||
public override uint Object => 3666746839; //3061944032
|
||||
public override int Price => 0;
|
||||
public override int Id => 13;
|
||||
public override string Name => "AssaultRifle";
|
||||
public override string Description => "Waffe";
|
||||
public override int Gewicht => 4780;
|
||||
public override string Einheit => "g";
|
||||
public override uint Object => 3666746839; //3061944032
|
||||
public override int Price => 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,15 +4,14 @@ using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class AssaultSmg : WeaponDealItem
|
||||
internal class AssaultSmg : WeaponDealItem
|
||||
{
|
||||
public override int Id => 14;
|
||||
public override string Name => "AssaultSmg";
|
||||
public override string Description => "Waffe";
|
||||
public override int Gewicht => 500;
|
||||
public override int Gewicht => 2300;
|
||||
public override string Einheit => "g";
|
||||
public override uint Object => 3666746839; //3061944032
|
||||
public override int Price => 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class AChips : FoodItem
|
||||
internal class AviateChips : ConsumableItem
|
||||
{
|
||||
public override int Id => 104;
|
||||
public override string Name => "Aviates Chips";
|
||||
public override string Name => "aviates Chips";
|
||||
public override string Description => "aviate liebt sie.";
|
||||
public override int Gewicht => 10;
|
||||
public override int Gewicht => 200;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 10;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 20;
|
||||
public override int Price => 1000;
|
||||
|
||||
public override float Cooldown => 5000;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
player.SafeSetHealth(player.Health + amountToAdd);
|
||||
player.SendNotification("Du hast ~y~" + Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
39
ReallifeGamemode.Server/Inventory/Items/Baklava.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
internal class Baklava : ConsumableItem
|
||||
{
|
||||
public override int Id => 105;
|
||||
public override string Name => "Baklava";
|
||||
public override string Description => "Dessert für dannach.";
|
||||
public override int Gewicht => 100;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 30;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 600;
|
||||
|
||||
public override float Cooldown => 20000;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
player.SafeSetHealth(player.Health + amountToAdd);
|
||||
player.SendNotification("Du hast ein ~y~" + Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
public override string Description => "Ein Fisch";
|
||||
public override int Gewicht => 2600;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 20;
|
||||
public override uint Object => 786272259;
|
||||
public override int Price => 0;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class Bier : FoodItem
|
||||
internal class Bier : ConsumableItem
|
||||
{
|
||||
public override int Id => 102;
|
||||
public override string Name => "Bier";
|
||||
public override string Description => "Ein Bier";
|
||||
public override int Gewicht => 10;
|
||||
public override string Description => "Ein Kolben";
|
||||
public override int Gewicht => 500;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 10;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 20;
|
||||
public override int Price => 50;
|
||||
|
||||
public override float Cooldown => 1000;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
//nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
|
||||
@@ -8,14 +9,29 @@
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public class Cannabis : IDroppableItem
|
||||
public class Cannabis : ConsumableItem
|
||||
{
|
||||
public int Id => 30;
|
||||
public string Name => "Grünes Gift";
|
||||
public string Description => "puff puff and pass";
|
||||
public int Gewicht => 50;
|
||||
public string Einheit => "g";
|
||||
public uint Object => 3076948544;
|
||||
public int Price => 0;
|
||||
public override int Id => 108;
|
||||
|
||||
public override string Name => "Grünes Gift";
|
||||
|
||||
public override string Description => "puff puff and pass";
|
||||
|
||||
public override int Gewicht => 2;
|
||||
|
||||
public override string Einheit => "g";
|
||||
|
||||
public override uint Object => 3076948544;
|
||||
|
||||
public override int Price => 0;
|
||||
|
||||
public override int HpAmount => -5;
|
||||
|
||||
public override float Cooldown => 20000;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
//nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
public override int Id => 6;
|
||||
public override string Name => "CarbineRifle";
|
||||
public override string Description => "Waffe";
|
||||
public override int Gewicht => 500;
|
||||
public override int Gewicht => 3200;
|
||||
public override string Einheit => "g";
|
||||
public override uint Object => 3666746839; //3061944032
|
||||
public override int Price => 0;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
/**
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Inventory Items Cheeseburger (Cheeseburger.cs)
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
@@ -6,15 +11,31 @@
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public class Cheeseburger : FoodItem
|
||||
public class Cheeseburger : ConsumableItem
|
||||
{
|
||||
public override int Id => 103;
|
||||
public override string Name => "Cheeseburger";
|
||||
public override string Description => "Ein Burger";
|
||||
public override int Gewicht => 50;
|
||||
public override string Description => "Extra käsig.";
|
||||
public override int Gewicht => 120;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 20;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 100;
|
||||
public override int Price => 500;
|
||||
public override float Cooldown => 7000;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
player.SafeSetHealth(player.Health + amountToAdd);
|
||||
player.SendNotification("Du hast einen ~y~" + Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class Chips : FoodItem
|
||||
internal class Chips : ConsumableItem
|
||||
{
|
||||
public override int Id => 100;
|
||||
public override string Name => "Chips";
|
||||
public override string Description => "Eine tüte Chips";
|
||||
public override int Gewicht => 10;
|
||||
public override string Description => "80% Luft, 20% Verpackung.";
|
||||
public override int Gewicht => 180;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 10;
|
||||
public override int HpAmount => 5;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 20;
|
||||
public override int Price => 5;
|
||||
|
||||
public override float Cooldown => 5500;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
player.SafeSetHealth(player.Health + amountToAdd);
|
||||
player.SendNotification("Du hast ~y~" + Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/**
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Inventory Items Chickenburger (Chickenburger.cs)
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
@@ -6,15 +8,22 @@
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public class Cocain : FoodItem
|
||||
public class Cocain : ConsumableItem
|
||||
{
|
||||
public override int Id => 31;
|
||||
public override string Name => "Kosks";
|
||||
public override int Id => 107;
|
||||
public override string Name => "Koks";
|
||||
public override string Description => "Rave";
|
||||
public override int Gewicht => 50;
|
||||
public override int Gewicht => 2;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 25;
|
||||
public override int HpAmount => -5;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 0;
|
||||
|
||||
public override float Cooldown => 20000;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
//nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,14 @@ using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class CombatPDW : WeaponDealItem
|
||||
internal class CombatPDW : WeaponDealItem
|
||||
{
|
||||
public override int Id => 12;
|
||||
public override string Name => "CombatPDW";
|
||||
public override string Description => "Waffe";
|
||||
public override int Gewicht => 500;
|
||||
public override string Einheit => "g";
|
||||
public override uint Object => 3666746839; //3061944032
|
||||
public override int Price => 0;
|
||||
public override int Id => 12;
|
||||
public override string Name => "CombatPDW";
|
||||
public override string Description => "Waffe";
|
||||
public override int Gewicht => 2300;
|
||||
public override string Einheit => "g";
|
||||
public override uint Object => 3666746839; //3061944032
|
||||
public override int Price => 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
class Combatpstiol : WeaponDealItem
|
||||
internal class Combatpstiol : WeaponDealItem
|
||||
{
|
||||
public override int Id => 4;
|
||||
public override string Name => "Combatpistol";
|
||||
public override string Description => "Waffe";
|
||||
public override int Gewicht => 500;
|
||||
public override int Gewicht => 950;
|
||||
public override string Einheit => "g";
|
||||
public override uint Object => 3666746839; //3061944032
|
||||
public override int Price => 0;
|
||||
|
||||
60
ReallifeGamemode.Server/Inventory/Items/ConsumableItem.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public abstract class ConsumableItem : IUsableItem
|
||||
{
|
||||
public abstract int HpAmount { get; }
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract int Gewicht { get; }
|
||||
public abstract string Einheit { get; }
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
public abstract float Cooldown { get; }
|
||||
|
||||
public abstract void Consume(UserItem uItem);
|
||||
|
||||
public bool Use(UserItem uItem)
|
||||
{
|
||||
User user = uItem.GetUser();
|
||||
if (user.Player == null || !user.Player.IsLoggedIn())
|
||||
return false;
|
||||
|
||||
if (InventoryManager.itemCooldown.ContainsKey(user.Player))
|
||||
{
|
||||
PlayerTimer timer = InventoryManager.itemCooldown[user.Player];
|
||||
int timeToNextUse = (int)(timer.startTime - DateTime.Now).TotalSeconds;
|
||||
uItem.GetUser().Player.TriggerEvent("Error", $"Versuche es nach {timeToNextUse} Sekunden erneut.");
|
||||
return false;
|
||||
}
|
||||
PlayerTimer playerTimer = new PlayerTimer(user.Player, this, Cooldown);
|
||||
playerTimer.Elapsed += _CooldownElapse;
|
||||
InventoryManager.itemCooldown.Add(user.Player, playerTimer);
|
||||
Consume(uItem);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void _CooldownElapse(Player player, dynamic usableItem)
|
||||
{
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
if (player == null || !player.IsLoggedIn())
|
||||
return;
|
||||
|
||||
if (!InventoryManager.itemCooldown.ContainsKey(player))
|
||||
return;
|
||||
|
||||
InventoryManager.itemCooldown[player].Stop();
|
||||
InventoryManager.itemCooldown.Remove(player);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public abstract class DropItem : IDroppableItem
|
||||
{
|
||||
public abstract int HpAmount { get; }
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
public override string Description => "Ein Fisch";
|
||||
public override int Gewicht => 7700;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 20;
|
||||
public override uint Object => 786272259;
|
||||
public override int Price => 0;
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public abstract class FoodItem : IUsableItem
|
||||
{
|
||||
public abstract int HpAmount { get; }
|
||||
public abstract int Id { get; }
|
||||
public abstract string Name { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract int Gewicht { get; }
|
||||
public abstract string Einheit { get; }
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
|
||||
public void Use(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
player.SafeSetHealth(player.Health + amountToAdd);
|
||||
player.SendNotification("Du hast ein/einen ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,14 +8,18 @@
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
public class Holz : IDroppableItem
|
||||
public class Holz : DropItem
|
||||
{
|
||||
public int Id => 32;
|
||||
public string Name => "Holz";
|
||||
public string Description => "Ich und mein Holz.";
|
||||
public int Gewicht => 650;
|
||||
public string Einheit => "g";
|
||||
public uint Object => 1805779401;
|
||||
public int Price => 0;
|
||||
public override int Id => 20;
|
||||
|
||||
public override string Name => "Holz";
|
||||
|
||||
public override string Description => "Ich und mein Holz.";
|
||||
public override int Gewicht => 650;
|
||||
public override string Einheit => "g";
|
||||
|
||||
public override uint Object => 1805779401;
|
||||
|
||||
public override int Price => 0;
|
||||
}
|
||||
}
|
||||
|
||||
39
ReallifeGamemode.Server/Inventory/Items/Kebab.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Database.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Managers;
|
||||
|
||||
namespace ReallifeGamemode.Server.Inventory.Items
|
||||
{
|
||||
internal class Kebab : ConsumableItem
|
||||
{
|
||||
public override int Id => 106;
|
||||
public override string Name => "Döner";
|
||||
public override string Description => "Von Emre selbst gemacht.";
|
||||
public override int Gewicht => 500;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 80;
|
||||
public override uint Object => 2240524752;
|
||||
public override int Price => 1800;
|
||||
|
||||
public override float Cooldown => 50000;
|
||||
|
||||
public override void Consume(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
int amountToAdd = HpAmount;
|
||||
if (player.Health + amountToAdd > 100)
|
||||
{
|
||||
amountToAdd = 100 - player.Health;
|
||||
}
|
||||
|
||||
player.SafeSetHealth(player.Health + amountToAdd);
|
||||
player.SendNotification("Du hast ein ~y~" + Name + " ~s~gegessen.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
public override string Description => "Du Lachs";
|
||||
public override int Gewicht => 4200;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 20;
|
||||
public override uint Object => 786272259;
|
||||
public override int Price => 0;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
public override int Gewicht => 10;
|
||||
public override string Einheit => "g";
|
||||
public override uint Object => 875075437;
|
||||
public override int Price => 0;
|
||||
public override int Price => 500;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
public override string Description => "Ein Fisch";
|
||||
public override int Gewicht => 11000;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 20;
|
||||
public override uint Object => 786272259;
|
||||
public override int Price => 0;
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
public abstract uint Object { get; }
|
||||
public abstract int Price { get; }
|
||||
|
||||
public void Use(UserItem uItem)
|
||||
public bool Use(UserItem uItem)
|
||||
{
|
||||
Player player = uItem.GetUser().Player;
|
||||
|
||||
if (uItem.ItemId != 200)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
Random random = new Random();
|
||||
int randomNumber = random.Next(1, 5);
|
||||
@@ -47,6 +47,7 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
}
|
||||
player.SendNotification("Du hast ~g~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~verwendet.", false);
|
||||
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace ReallifeGamemode.Server.Inventory.Items
|
||||
public override string Description => "Ein Fisch";
|
||||
public override int Gewicht => 5000;
|
||||
public override string Einheit => "g";
|
||||
public override int HpAmount => 20;
|
||||
public override uint Object => 786272259;
|
||||
public override int Price => 0;
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace ReallifeGamemode.Server.Job
|
||||
public const uint VEHICLE_INTERMEDIATE = (uint)VehicleHash.Coach;
|
||||
public const uint VEHICLE_PROFESSIONAL = (uint)VehicleHash.Tourbus;
|
||||
|
||||
public const int WAGE_BEGINNER = 800;
|
||||
public const int WAGE_INTERMEDIATE = 1200;
|
||||
public const int WAGE_PROFESSIOAL = 1800;
|
||||
public const int WAGE_BEGINNER = 400;
|
||||
public const int WAGE_INTERMEDIATE = 600;
|
||||
public const int WAGE_PROFESSIOAL = 900;
|
||||
|
||||
public const string BEGINNER = "Anfänger";
|
||||
public const string INTERMEDIATE = "Fortgeschrittener";
|
||||
@@ -345,8 +345,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
if (type == PROFESSIONAL && user.BusSkill < SKILL_PROFESSIONAL) { player.TriggerEvent("MenuSelect:Error"); return; }
|
||||
|
||||
List<Vector3> selectedRoute = new List<Vector3>();
|
||||
int index = -1;
|
||||
|
||||
int index;
|
||||
if (playerRouteCurrent.ContainsKey(player.Name))
|
||||
{
|
||||
index = getPlayerRouteInex(player);
|
||||
@@ -444,6 +443,14 @@ namespace ReallifeGamemode.Server.Job
|
||||
player.SendChatMessage("~y~[JOB]: ~w~Die neue Route lädt. Bitte warten...");
|
||||
string type = getPlayerRouteType(player);
|
||||
|
||||
if (type == BEGINNER)
|
||||
BusJobEvents.payWage(player, WAGE_BEGINNER);
|
||||
else if (type == INTERMEDIATE)
|
||||
BusJobEvents.payWage(player, WAGE_INTERMEDIATE);
|
||||
else if (type == PROFESSIONAL)
|
||||
BusJobEvents.payWage(player, WAGE_PROFESSIOAL);
|
||||
|
||||
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
if (type == BEGINNER)
|
||||
@@ -467,6 +474,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
NAPI.ClientEvent.TriggerClientEventForAll("SERVER:setIndicatorStatus", veh.Handle.Value, data.Left, data.Right);
|
||||
}
|
||||
|
||||
|
||||
public void BusCheckpoint(Player player)
|
||||
{
|
||||
if (!player.IsInVehicle || player.VehicleSeat != 0) return;
|
||||
@@ -565,6 +573,11 @@ namespace ReallifeGamemode.Server.Job
|
||||
return;
|
||||
}
|
||||
|
||||
if(!playerVehiclePair.ContainsKey(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (JobManager.playerTimersJobVehicleRespawn.ContainsKey(player))
|
||||
{
|
||||
JobManager.playerTimersJobVehicleRespawn[player].Stop();
|
||||
@@ -582,7 +595,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
player.SendChatMessage("~y~[JOB] ~w~Bist du nicht in 30 Sekunden zurück, ~r~wird der Job beendet!");
|
||||
}
|
||||
|
||||
private void JobTimerElapsed(Player player, Vehicle vehicle)
|
||||
private void JobTimerElapsed(Player player, dynamic vehicle)
|
||||
{
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
@@ -620,7 +633,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
payWage(player, BusDriverJob.WAGE_PROFESSIOAL / BusDriverJob.playerRouteCurrent[player.Name].Count);
|
||||
}
|
||||
|
||||
private void payWage(Player player, int wage)
|
||||
public static void payWage(Player player, int wage)
|
||||
{
|
||||
using var dbContext = new DatabaseContext();
|
||||
User user = player.GetUser(dbContext);
|
||||
@@ -640,8 +653,6 @@ namespace ReallifeGamemode.Server.Job
|
||||
player.SendChatMessage($"~y~[JOB]: ~w~Du kannst jetzt auch mit dem Tourbus fahren!");
|
||||
}
|
||||
|
||||
BusDriverJob job = JobManager.GetJob<BusDriverJob>();
|
||||
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
public void removeClientFromData(Player player)
|
||||
{
|
||||
if (client1 == player) { client1 = null; }
|
||||
if (client2 == player) { client2 = null;}
|
||||
if (client2 == player) { client2 = null; }
|
||||
}
|
||||
|
||||
public int getTrashCount()
|
||||
|
||||
@@ -292,7 +292,6 @@ namespace ReallifeGamemode.Server.Job
|
||||
_CHANGING_VEHICLE.Remove(player);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (JobManager.playerTimersJobVehicleRespawn.ContainsKey(player))
|
||||
{
|
||||
@@ -310,7 +309,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
player.SendChatMessage("~y~[JOB] ~w~Bist du nicht in 30 Sekunden zurück, ~r~wird der Job beendet!");
|
||||
}
|
||||
|
||||
private void JobTimerElapsed(Player player, Vehicle vehicle)
|
||||
private void JobTimerElapsed(Player player, dynamic vehicle)
|
||||
{
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
|
||||
@@ -180,7 +180,11 @@ namespace ReallifeGamemode.Server.Job
|
||||
|
||||
public void MuellmannJobBeenden(Player player)
|
||||
{
|
||||
JobBase job = JobManager.GetJob(player.GetUser().JobId ?? -1);
|
||||
if (player == null || !player.IsLoggedIn())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.TriggerEvent("SERVER:MuellmannStatusFalse");
|
||||
player.TriggerEvent("SERVER:MuellmannBCSEntfernen");
|
||||
|
||||
@@ -436,7 +440,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
JobManager.playerTimersJobVehicleRespawn[player] = playerTimer;
|
||||
}
|
||||
|
||||
private void JobTimerElapsed(Player player, Vehicle vehicle)
|
||||
private void JobTimerElapsed(Player player, dynamic vehicle)
|
||||
{
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
FactionHelper.ResetPlayer(player, own, dbContext);
|
||||
|
||||
own.Faction = u.Faction;
|
||||
own.FactionId = u.FactionId;
|
||||
own.FactionLeader = false;
|
||||
own.FactionRank = dbContext
|
||||
.FactionRanks
|
||||
@@ -260,13 +260,13 @@ namespace ReallifeGamemode.Server.Managers
|
||||
UpdateCharacterCloth.LoadCharacterDefaults(targetPlayer);
|
||||
ChatService.SendMessage(targetPlayer, "!{02FCFF}Du wurdest von " + player.Name + " aus der Fraktion geworfen.");
|
||||
FactionHelper.ResetPlayer(targetPlayer, targetUser, dbContext);
|
||||
}
|
||||
}
|
||||
Medic.UpdateDutyMedics();
|
||||
targetUser.FactionRankId = null;
|
||||
targetUser.FactionId = null;
|
||||
targetUser.SetBlipAndNametagColor();
|
||||
|
||||
ChatService.SendMessage(player, "!{02FCFF}Du hast " + targetUser.Name + " aus der Fraktion geworfen.");
|
||||
|
||||
ChatService.SendMessage(player, "!{02FCFF}Du hast " + targetUser.Name + " aus der Fraktion geworfen.");
|
||||
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
@@ -449,7 +449,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
[RemoteEvent("CLIENT:InteractionMenu_PlayerVehicleInteraction")]
|
||||
public void PlayerVehicleInteraction(Player player, int id, string selection)
|
||||
{
|
||||
using var dbContext = new DatabaseContext(true);
|
||||
using var dbContext = new DatabaseContext();
|
||||
var user = player.GetUser(dbContext);
|
||||
|
||||
var userVehicle = dbContext.UserVehicles.Where(v => v.Id == id && v.UserId == user.Id).FirstOrDefault();
|
||||
@@ -467,7 +467,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
else if (selection == "Verkaufen")
|
||||
{
|
||||
var vehPrice = userVehicle.Price;
|
||||
var backPrice = (int)(vehPrice * 0.6);
|
||||
var backPrice = (int)(vehPrice * 0.4);
|
||||
|
||||
user.BankAccount.Balance += backPrice;
|
||||
|
||||
@@ -483,9 +483,14 @@ namespace ReallifeGamemode.Server.Managers
|
||||
[RemoteEvent("CLIENT:InteractionMenu_FactionVehicleInteraction")]
|
||||
public void FactionVehicleInteraction(Player player, int id, string selection)
|
||||
{
|
||||
using var dbContext = new DatabaseContext(true);
|
||||
using var dbContext = new DatabaseContext();
|
||||
var user = player.GetUser(dbContext);
|
||||
|
||||
if (user.FactionId == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var factionVehicle = dbContext.FactionVehicles.ToList().Where(v => v.Id == id && v.GetOwners().Contains(user.FactionId.Value)).FirstOrDefault();
|
||||
if (factionVehicle == null)
|
||||
{
|
||||
@@ -498,46 +503,42 @@ namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
player.TriggerEvent("SERVER:Util_setWaypoint", veh.Position.X, veh.Position.Y);
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:InteractionMenu_FactionVehicleInteractionSell")]
|
||||
public void FactionVehicleInteractionSell(Player player, int id, string selection)
|
||||
{
|
||||
using var dbContext = new DatabaseContext(true);
|
||||
var user = player.GetUser(dbContext);
|
||||
|
||||
var factionVehicle = dbContext.FactionVehicles.ToList().Where(v => v.Id == id && v.GetOwners().Contains(user.FactionId.Value)).FirstOrDefault();
|
||||
if (factionVehicle == null)
|
||||
else if (selection == "Verkaufen")
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Das Fahrzeug wurde nicht gefunden");
|
||||
}
|
||||
|
||||
GTANetworkAPI.Vehicle veh = VehicleManager.GetVehicleFromServerVehicle(factionVehicle);
|
||||
|
||||
if (selection == "Verkaufen")
|
||||
{
|
||||
if (dbContext.FactionVehicles.ToList().Where(f => f.GetOwners().Contains(user.FactionId.Value)).Count() <= 6)
|
||||
if (!user.FactionLeader)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Die Fraktion muss mindestens 6 Fahrzeuge besitzen");
|
||||
return;
|
||||
}
|
||||
|
||||
if (factionVehicle.Model == VehicleHash.Policet || factionVehicle.Model == VehicleHash.Burrito3)
|
||||
if (user.Faction.StateOwned)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Der WT kann nicht verkauft werden");
|
||||
ChatService.ErrorMessage(player, "Der Fuhrpark der Staatsfraktionen kann über die Leaderverwaltung geändert werden");
|
||||
return;
|
||||
}
|
||||
|
||||
var backPrice = factionVehicle.BuyPrice;
|
||||
var factionVehicleCount = dbContext.FactionVehicles.ToList().Where(v => v.Id == id && v.GetOwners().Contains(user.FactionId.Value)).Count();
|
||||
if (factionVehicleCount <= 6)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Die Fraktion braucht mindestens 6 Fahrzeuge");
|
||||
return;
|
||||
}
|
||||
|
||||
var price = dbContext.ShopVehicles.Where(v => v.Model == factionVehicle.Model && v.Active).Select(s => new { s.Price }).FirstOrDefault();
|
||||
if (price == null)
|
||||
{
|
||||
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~ Deine Fraktion hat durch den Autoverkauf ~g~{backPrice.ToMoneyString()}~s~ erhalten.");
|
||||
ChatService.SendMessage(player, $"~b~[INFO]~s~ Die Fraktionskasse ~g~{backPrice.ToMoneyString()}~s~ erhalten.");
|
||||
|
||||
dbContext.FactionVehicles.Remove(factionVehicle);
|
||||
dbContext.SaveChanges();
|
||||
|
||||
veh.Delete();
|
||||
veh?.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,86 +589,77 @@ namespace ReallifeGamemode.Server.Managers
|
||||
public void InteractionMenu_LSPD_Points3(Player player, string jsonNameOrId, string jsoAmount, string jsonReason)
|
||||
{
|
||||
string nameOrId = (string)JsonConvert.DeserializeObject(jsonNameOrId);
|
||||
int amount = Int32.Parse((string)JsonConvert.DeserializeObject(jsoAmount));
|
||||
string reason = (string)JsonConvert.DeserializeObject(jsonReason);
|
||||
Player target = PlayerService.GetPlayerByNameOrId(nameOrId);
|
||||
string playername = NAPI.Player.GetPlayerName(player);
|
||||
string targetname = NAPI.Player.GetPlayerName(target);
|
||||
|
||||
if (!int.TryParse((string)JsonConvert.DeserializeObject(jsoAmount), out int amount))
|
||||
{
|
||||
player.SendNotification("~r~Es muss eine gültige Zahl für die Punkte angegeben werden!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (target == null || !target.IsLoggedIn())
|
||||
{
|
||||
ChatService.PlayerNotFound(player);
|
||||
return;
|
||||
}
|
||||
else if (target.GetUser().DriverLicenseVehicle == false && target.GetUser().DriverLicenseBike == false)
|
||||
{
|
||||
player.SendNotification("~r~Spieler hat weder Auto- noch Motorradführerschein!");
|
||||
}
|
||||
else if (target == player)
|
||||
|
||||
if (target == player)
|
||||
{
|
||||
player.SendNotification("~r~Du kannst dir selbst keine Punkte setzen!");
|
||||
return;
|
||||
}
|
||||
|
||||
using var dbContext = new DatabaseContext();
|
||||
User targetUser = target.GetUser(dbContext);
|
||||
|
||||
if(targetUser == null)
|
||||
{
|
||||
ChatService.PlayerNotFound(player);
|
||||
return;
|
||||
}
|
||||
|
||||
if (targetUser.DriverLicenseVehicle == false && targetUser.DriverLicenseBike == false)
|
||||
{
|
||||
player.SendNotification("~r~Spieler hat weder Auto- noch Motorradführerschein!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (amount < -13 || amount > 13)
|
||||
{
|
||||
player.SendNotification("~r~Du kannst nur zwischen 1 und 12 Punkte verteilen!");
|
||||
return;
|
||||
}
|
||||
|
||||
targetUser.Points += amount;
|
||||
|
||||
player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~.");
|
||||
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben.", true);
|
||||
ChatService.HQMessage(targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten. Gesamt: " + targetUser.Points);
|
||||
|
||||
if (targetUser.Points < 0)
|
||||
{
|
||||
targetUser.Points = 0;
|
||||
}
|
||||
else if (targetUser.Points >= 12)
|
||||
{
|
||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true);
|
||||
target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); //FlashNotif
|
||||
|
||||
ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr.");
|
||||
|
||||
targetUser.Points = 0;
|
||||
targetUser.DriverLicenseVehicle = false;
|
||||
targetUser.DriverLicenseBike = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (amount > -13 && amount < 13)
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User target2 = target.GetUser(dbContext);
|
||||
target2.Points += amount;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~.");
|
||||
target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben.", true);
|
||||
ChatService.BroadcastFaction("!{#8181E9}HQ: " + targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten. Gesamt: " + target.GetUser().Points, new List<int>() { 1, 3 });
|
||||
if (target.GetUser().Points < 0)
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User target2 = target.GetUser(dbContext);
|
||||
target2.Points = 0;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
else if (target.GetUser().Points >= 12)
|
||||
{
|
||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true);
|
||||
target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); //FlashNotif
|
||||
ChatService.HQMessage(targetname + "hat von" + playername + " " + amount + " Strafpunkt erhalten(e). Gesamt: " + target.GetUser().Points);
|
||||
foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
User copUser = copPlayer.GetUser();
|
||||
if (copUser == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (copUser.FactionId == 1 || copUser.FactionId == 3)
|
||||
{
|
||||
if (copUser.GetData<bool>("duty") == true)
|
||||
{
|
||||
ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr.");
|
||||
}
|
||||
}
|
||||
}
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User target2 = target.GetUser(dbContext);
|
||||
target2.Points = 0;
|
||||
target2.DriverLicenseVehicle = false;
|
||||
target2.DriverLicenseBike = false;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{target.GetUser().Points}/12 ~x~Strafpunkten.", true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendNotification("~r~Du kannst nur zwischen 1 und 12 Punkte verteilen!");
|
||||
}
|
||||
target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{targetUser.Points}/12 ~x~Strafpunkten.", true);
|
||||
}
|
||||
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:InteractionMenu_Ticket")]
|
||||
|
||||
@@ -15,7 +15,6 @@ using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Services;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Managers InventoryManager (InventoryManager.cs)
|
||||
* @author hydrant, VegaZ, balbo
|
||||
@@ -34,7 +33,9 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
public static Dictionary<Player, List<InventoryItem>> backpackItems { get; set; } = new Dictionary<Player, List<InventoryItem>>();
|
||||
public static Dictionary<Player, List<InventoryItem>> vehicleItems { get; set; } = new Dictionary<Player, List<InventoryItem>>();
|
||||
private static Timer aTimer;
|
||||
|
||||
public static Dictionary<Player, PlayerTimer> itemCooldown = new Dictionary<Player, PlayerTimer>();
|
||||
|
||||
public class InventoryItem
|
||||
{
|
||||
public string Name;
|
||||
@@ -87,14 +88,13 @@ namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
ServerVehicle carlocked = veh.GetServerVehicle(dbContext);
|
||||
|
||||
if (carlocked.Locked == true)
|
||||
if (carlocked == null || carlocked.Locked == true)
|
||||
{
|
||||
player.TriggerEvent("Error", "Das Fahrzeug ist abgeschlossen!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<VehicleItem> itemList = GetVehicleItems(veh);
|
||||
|
||||
if (itemList == null)
|
||||
@@ -121,7 +121,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
};
|
||||
vehicleItems[player].Add(newItem);
|
||||
}
|
||||
|
||||
player.SetSharedData("setVehicleTrunk", veh.GetVehicleTrunkSize());
|
||||
player.SetSharedData("vehicleItems", JsonConvert.SerializeObject(vehicleItems[player].ToArray()));
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
RemoveUserItem(user, item, itemAmount);
|
||||
AddItemToVehicleInventory(veh, itemID, itemAmount);
|
||||
|
||||
SetVehicleItems(player);
|
||||
SetBackpackItems(player);
|
||||
VehicleItem vehicleItem = context.VehicleItems.Where(f => f.ItemId == itemID && f.Vehicle == VehicleManager.GetServerVehicleFromVehicle(veh, context)).FirstOrDefault();
|
||||
context.SaveChanges();
|
||||
IItem iItem = GetItemById(itemID);
|
||||
@@ -426,7 +426,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
int setAmount = 0;
|
||||
for (int i = 1; i <= amount; i++)
|
||||
{
|
||||
if (GetVehicleInventoryWeight(veh) + (i * GetItemById(itemId).Gewicht) > 200000)
|
||||
if (GetVehicleInventoryWeight(veh) + (i * GetItemById(itemId).Gewicht) > veh.GetVehicleTrunkSize())
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
case "use":
|
||||
if (iItem == null)
|
||||
{
|
||||
player.TriggerEvent("Error", "Dieses Essen existiert nicht.");
|
||||
player.TriggerEvent("Error", "Dieses Item existiert nicht.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -529,10 +529,12 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
if (iItem is IUsableItem usableItemObj)
|
||||
{
|
||||
usableItemObj.Use(fItem);
|
||||
List<InventoryItem> items = backpackItems[player];
|
||||
player.SetSharedData("backpackItems", JsonConvert.SerializeObject(items.ToArray()));
|
||||
player.TriggerEvent("aproveUse", 1, iItem.Name);
|
||||
if (usableItemObj.Use(fItem))
|
||||
{
|
||||
List<InventoryItem> items = backpackItems[player];
|
||||
player.SetSharedData("backpackItems", JsonConvert.SerializeObject(items.ToArray()));
|
||||
player.TriggerEvent("aproveUse", 1, iItem.Name);
|
||||
}
|
||||
}
|
||||
else player.TriggerEvent("Error", "Du kannst dieses Item nicht benutzen.");
|
||||
break;
|
||||
|
||||
@@ -155,7 +155,6 @@ namespace ReallifeGamemode.Server.Managers
|
||||
[ServerEvent(Event.PlayerExitVehicle)]
|
||||
public void JobManagerPlayerExitVehicle(Player player, Vehicle veh)
|
||||
{
|
||||
ServerVehicle sVeh = VehicleManager.GetServerVehicleFromVehicle(veh);
|
||||
User u = player.GetUser();
|
||||
|
||||
if (u.JobId == null) return;
|
||||
@@ -168,75 +167,6 @@ namespace ReallifeGamemode.Server.Managers
|
||||
job.StartJobEndTimer(player);
|
||||
}
|
||||
|
||||
public void PlayerTimer_Elapsed(Player player, Vehicle veh)
|
||||
{
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
//Vehicle LastVehicle = player.GetData<Vehicle>("LastVehicle");
|
||||
Vehicle LastVehicle = veh;
|
||||
JobBase job = GetJob(player?.GetUser()?.JobId ?? -1);
|
||||
if (LastVehicle == null || job == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (LastVehicle.GetServerVehicle() is JobVehicle vehJ)
|
||||
{
|
||||
if (LastVehicle.GetData<bool>("timerJobVehicleRespawn") == true)
|
||||
{
|
||||
if (vehJ.GetJob().GetUsersInJob().Contains(player))
|
||||
{
|
||||
if (LastVehicle != null)
|
||||
{
|
||||
if (job.Id != 2) //Müllman Handelt Fahrzeug respawn eigenständig
|
||||
{
|
||||
LastVehicle.ResetData("timerJobVehicleRespawn");
|
||||
ServerVehicle sVeh = VehicleManager.GetServerVehicleFromVehicle(LastVehicle);
|
||||
ServerVehicleExtensions.Spawn(sVeh, LastVehicle);
|
||||
}
|
||||
|
||||
job.StopJob(player);
|
||||
ChatService.SendMessage(player, $"~y~[JOB]~s~ Du hast deinen Job ~o~{job.Name}~s~ beendet.");
|
||||
CheckPointHandle.DeleteCheckpoints(player);
|
||||
if (!player.HasData("isDead") || player.GetData<bool>("isDead") == false)
|
||||
{
|
||||
if (player.GetUser().JobId == 1)//Taxifahrer
|
||||
{
|
||||
player.TriggerEvent("CLIENT:stopFare");
|
||||
player.SafeTeleport(new Vector3(-628.598388671875, -2107.609130859375, 6.072586536407471));
|
||||
player.Heading = (-171.50303649902344f);
|
||||
}
|
||||
if (player.GetUser().JobId == 2)//Müllmann
|
||||
{
|
||||
player.SafeTeleport(new Vector3(485.4114685058594, -2173.25, 5.918273448944092));
|
||||
player.Heading = (-15.922085762023926f);
|
||||
}
|
||||
if (player.GetUser().JobId == 3)//Pilot
|
||||
{
|
||||
if (!player.HasData("PilotenBase") || player.GetData<int>("PilotenBase") == 1) //Sandyshores
|
||||
{
|
||||
player.SafeTeleport(new Vector3(1707.2711181640625, 3276.216064453125, 41.155494689941406));
|
||||
player.Heading = (-154.65234375f);
|
||||
}
|
||||
if (player.HasData("PilotenBase") && player.GetData<int>("PilotenBase") == 2) //LS Airport
|
||||
{
|
||||
player.SafeTeleport(new Vector3(-1622.48, -3151.58, 13));
|
||||
player.Heading = (48.44f);
|
||||
}
|
||||
}
|
||||
if (player.GetUser().JobId == 4)//Busfahrer
|
||||
{
|
||||
player.SafeTeleport(new Vector3(-535.46, -2144.97, 5.95));
|
||||
player.Heading = (57.03f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:Job_StopJob")]
|
||||
public void StopJob(Player player)
|
||||
{
|
||||
|
||||
@@ -9,15 +9,14 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
public class VehicleManager : Script
|
||||
{
|
||||
|
||||
public static Dictionary<Vehicle, Dictionary<string, DateTime>> lastDriversInVehicle = new Dictionary<Vehicle, Dictionary<string, DateTime>>();
|
||||
|
||||
private static readonly List<string> _enabledMods = new List<string>()
|
||||
{
|
||||
"ninef",
|
||||
@@ -758,6 +757,19 @@ namespace ReallifeGamemode.Server.Managers
|
||||
"winky",
|
||||
"polamggtr", //mod
|
||||
"newsfrog", //mod
|
||||
"fibn",//mod
|
||||
"fibg",//mod
|
||||
"fibd",//mod
|
||||
"fibs",//mod
|
||||
"fibc",//mod
|
||||
"fibn2",//mod
|
||||
"fibx",//mod
|
||||
"fibg2",//mod
|
||||
"fibd2",//mod
|
||||
"fibj",//mod
|
||||
"fibn3",//mod
|
||||
"fibr"//mod
|
||||
|
||||
};
|
||||
|
||||
private static readonly Dictionary<int, NetHandle> _serverVehicles = new Dictionary<int, NetHandle>();
|
||||
@@ -811,7 +823,6 @@ namespace ReallifeGamemode.Server.Managers
|
||||
v.SetSharedData("drivenDistance", (float)distanceDriven);
|
||||
});
|
||||
|
||||
|
||||
if (DateTime.UtcNow.Subtract(lastSave).Seconds >= 30)
|
||||
{
|
||||
lastSave = DateTime.UtcNow;
|
||||
@@ -835,7 +846,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static void AddVehicle(ServerVehicle serverVehicle, Vehicle vehicle)
|
||||
{
|
||||
if (_serverVehicles.ContainsKey(serverVehicle.Id))
|
||||
@@ -902,7 +913,6 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
foreach (KeyValuePair<int, NetHandle> pair in _serverVehicles)
|
||||
{
|
||||
|
||||
if (pair.Value == veh.Handle)
|
||||
{
|
||||
return dbContext.ServerVehicles.Find(pair.Key);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace ReallifeGamemode.Server.Report
|
||||
//ChatService.BroadcastAdmin("Eingehendes Ticket von " + client.Name + ": " + message + " (Benutze /showtickets)", AdminLevel.ADMIN);
|
||||
}
|
||||
|
||||
[Command("showtickets", "~m~Benutzung: ~s~/showtickets")]
|
||||
[Command("showtickets", "~m~Benutzung: ~s~/showtickets", Alias = "st")]
|
||||
public void CmdAdminShowtickets(Player client)
|
||||
{
|
||||
if (!client.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||
@@ -33,11 +33,12 @@ namespace ReallifeGamemode.Server.Report
|
||||
return;
|
||||
}
|
||||
|
||||
if (listReports.Count == 0)
|
||||
if (listReports.FindAll(e => (e.isAssigned() == false)).Count == 0)
|
||||
{
|
||||
ChatService.ErrorMessage(client, "Im Moment gibt es keine Tickets.");
|
||||
return;
|
||||
}
|
||||
|
||||
User user = client.GetUser();
|
||||
List<string> listPlayers = new List<string>();
|
||||
List<string> listTicketnames = new List<string>();
|
||||
|
||||
@@ -108,12 +108,14 @@ namespace ReallifeGamemode.Server.Services
|
||||
}
|
||||
}
|
||||
|
||||
string toSend = message;
|
||||
|
||||
if(getAddInfoMessage != null)
|
||||
{
|
||||
message += getAddInfoMessage(p);
|
||||
toSend += getAddInfoMessage(p);
|
||||
}
|
||||
|
||||
ChatService.SendMessage(p, message);
|
||||
ChatService.SendMessage(p, toSend);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Timers;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
@@ -10,9 +11,12 @@ namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
private readonly Player player;
|
||||
private readonly Vehicle veh;
|
||||
private readonly IUsableItem usableItem;
|
||||
private readonly Timer timer;
|
||||
public readonly DateTime startTime;
|
||||
|
||||
public delegate void PlayerTimerElapsed(Player player, dynamic dynamic);
|
||||
|
||||
public delegate void PlayerTimerElapsed(Player player, Vehicle veh);
|
||||
public event PlayerTimerElapsed Elapsed;
|
||||
|
||||
public PlayerTimer(Player player, Vehicle veh = null, int milliseconds = 1000)
|
||||
@@ -25,9 +29,23 @@ namespace ReallifeGamemode.Server.Util
|
||||
this.timer.Start();
|
||||
}
|
||||
|
||||
public PlayerTimer(Player player, IUsableItem usableItem, float milliseconds = 1000)
|
||||
{
|
||||
this.player = player;
|
||||
this.usableItem = usableItem;
|
||||
this.startTime = DateTime.Now.AddMilliseconds(milliseconds);
|
||||
|
||||
this.timer = new Timer(milliseconds);
|
||||
this.timer.Elapsed += Timer_Elapsed;
|
||||
this.timer.Start();
|
||||
}
|
||||
|
||||
private void Timer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
Elapsed?.Invoke(player, veh);
|
||||
if (veh != null)
|
||||
Elapsed?.Invoke(player, veh);
|
||||
else
|
||||
Elapsed?.Invoke(player, usableItem);
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
|
||||
@@ -27,12 +27,8 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
}
|
||||
*/
|
||||
|
||||
public static void ResetWantedTimeToElapse(Player client)
|
||||
public static void ResetWantedTimeToElapse(User user)
|
||||
{
|
||||
User user = client.GetUser();
|
||||
if (user.FactionId == 1 || user.FactionId == 3)
|
||||
return;
|
||||
|
||||
waTimer[user.Id] = WantedEscapeTime;
|
||||
}
|
||||
|
||||
@@ -45,7 +41,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
if (user != null && user.Wanteds > 0)
|
||||
{
|
||||
if (!waTimer.ContainsKey(user.Id))
|
||||
ResetWantedTimeToElapse(player);
|
||||
ResetWantedTimeToElapse(user);
|
||||
|
||||
bool isNearCop = false;
|
||||
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
||||
@@ -70,7 +66,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
|
||||
if (waTimer[user.Id] <= 0)
|
||||
{
|
||||
ResetWantedTimeToElapse(player);
|
||||
ResetWantedTimeToElapse(user);
|
||||
player.SendChatMessage("~y~Du hast erfolgreich einen Wanted abgetaucht.");
|
||||
user.Wanteds -= 1;
|
||||
if (user.Wanteds == 0)
|
||||
@@ -82,7 +78,15 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
waTimer[user.Id] = WantedEscapeTime;
|
||||
}
|
||||
else if (!isNearCop)
|
||||
{
|
||||
player.TriggerEvent("SERVER:SetWantedFlash", true);
|
||||
waTimer[user.Id] -= 2500;
|
||||
}
|
||||
else if (isNearCop)
|
||||
{
|
||||
player.TriggerEvent("SERVER:SetWantedFlash", false);
|
||||
ResetWantedTimeToElapse(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,24 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
||||
private const int WEAPON_AMOUNT_COP_STUNGUN = 4;
|
||||
public static bool checkWeaponDbyVehicle(Vehicle vehicle)
|
||||
{
|
||||
if (!vehicle.HasData("WeaponDealLoad") || vehicle.GetData<bool>("WeaponDealLoad") == false)
|
||||
return false;
|
||||
if ((vehicle.HasData("WeaponDealLoad") && vehicle.GetData<bool>("WeaponDealLoad") == true) ||
|
||||
(vehicle.HasData("weaponDeal") && vehicle.GetData<bool>("weaponDeal") == true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
[RemoteEvent("startWeaponDeal")]
|
||||
public void SrvEVENT_startWeaponDeal(Player client)
|
||||
{
|
||||
var user = client.GetUser();
|
||||
if(user == null || user.FactionId == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
using (var context = new DatabaseContext(true))
|
||||
{
|
||||
FactionVehicle factionVehicle = context.FactionVehicles.Where(f => f.Model == VehicleHash.Burrito3 || f.Model == VehicleHash.Policet).ToList().Where(f => f.GetOwners().Contains(user.FactionId ?? 0)).FirstOrDefault();
|
||||
@@ -37,10 +45,9 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Vehicle fVeh = VehicleManager.GetVehicleFromServerVehicle(factionVehicle);
|
||||
|
||||
if (fVeh.HasData("weaponDeal") && fVeh.GetData<bool>("weaponDeal") == true)
|
||||
if (checkWeaponDbyVehicle(fVeh))
|
||||
{
|
||||
ChatService.ErrorMessage(client, "Es läuft aktuell schon ein Waffentransport");
|
||||
return;
|
||||
@@ -55,7 +62,7 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
||||
|
||||
WeaponDealPoints.factionWeaponDeal[user.FactionId.Value] = -1;
|
||||
Vector3 vector;
|
||||
vector = WeaponDealPoints.getRndWD_Route(client.GetUser().FactionId.Value);
|
||||
vector = WeaponDealPoints.getRndWD_Route(user.FactionId.Value);
|
||||
if (vector == new Vector3())
|
||||
return;
|
||||
fVeh.SetData<Vector3>("weaponDealPoint", vector);
|
||||
@@ -189,7 +196,7 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
||||
fVeh.AddAttachment("weapondeal1", false);
|
||||
fVeh.AddAttachment("weapondeal2", false);
|
||||
InventoryManager.RemoveAllItemsfromVehicleInventory(fVeh);
|
||||
int oMembers = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() && p.GetUser(context).FactionId == user.FactionId).Count();
|
||||
int oMembers = NAPI.Pools.GetAllPlayers().Where(p => !p.IsAfk() && p.IsLoggedIn() && p.GetUser(context).FactionId == user.FactionId).Count();
|
||||
|
||||
if (factionVehicle.GetOwners().Contains(8) || factionVehicle.GetOwners().Contains(7))
|
||||
{
|
||||
|
||||