Merge branch 'develop' into 'master'
Version 0.0.5 See merge request log-gtav/reallife-gamemode!53
@@ -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]],
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Menu, Point, UIMenuItem } from "../libs/NativeUI";
|
||||
import { createMenuItem } from "../util";
|
||||
import moneyformat from "../moneyformat";
|
||||
var screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
var menu: Menu = new Menu("Polizeirevier", "Die Hilfestelle der Polizei", new Point(0, screenRes.y / 3));
|
||||
var menu: Menu = new Menu("", "Hier kannst du den Waffenschein erwerben", new Point(0, screenRes.y / 3), "shopui_title_gunclub", "shopui_title_gunclub");
|
||||
|
||||
menu.AddItem(createMenuItem("Waffenschein kaufen", "Erwerbe einen Waffenschein", (item) => {
|
||||
item.SetRightLabel("$" + moneyformat(5000));
|
||||
@@ -24,7 +24,7 @@ menu.MenuClose.on(() => {
|
||||
game.events.add("SERVER:PoliceDepartment_EnterColShape", () => {
|
||||
//game.ui.setHelpText("Drücke ~INPUT_CONTEXT~, um das Menü des Polizeireviers zu öffnen");
|
||||
|
||||
mp.events.call("renderHelpTextOnScreen", "~s~Drücke ~g~E~s~ um das Menü des ~b~Polizeireviers ~s~zu öffnen")
|
||||
//mp.events.call("renderHelpTextOnScreen", "~s~Drücke ~g~E~s~ um das Menü des ~b~Polizeireviers ~s~zu öffnen")
|
||||
game.events.bindKey(Key.E, false, keyPressHandler);
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
});
|
||||
|
||||
89
ReallifeGamemode.Client/Interaction/ammunation/ammunation.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import * as NativeUI from '../../libs/NativeUI';
|
||||
|
||||
const Menu = NativeUI.Menu;
|
||||
const MenuItem = NativeUI.UIMenuItem;
|
||||
const MenuListItem = NativeUI.UIMenuListItem;
|
||||
const MenuCheckboxItem = NativeUI.UIMenuCheckboxItem;
|
||||
const BadgeStyle = NativeUI.BadgeStyle;
|
||||
const Point = NativeUI.Point;
|
||||
const ItemsCollection = NativeUI.ItemsCollection;
|
||||
const Color = NativeUI.Color;
|
||||
|
||||
export default function ammunation(globalData: IGlobalData) {
|
||||
|
||||
var screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
var weapons: Weapon[];
|
||||
|
||||
mp.events.add("AmmunationShop:LoadNativeUI", (weaponList: string) => {
|
||||
|
||||
weapons = JSON.parse(weaponList);
|
||||
var menu = getAmmunationMenu();
|
||||
|
||||
//Schaut nach ob mindestens eine Waffe in weapons existiert welche die CategoryId beinhaltet
|
||||
for (var c = 1; c < 10; c++) {
|
||||
switch (c) {
|
||||
case 1: { //Meelee
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2: { //Pistolen
|
||||
if (weapons.find(w => w.CategoryId == c)) {
|
||||
var pistolItem = new MenuItem("Pistolen", "Das kleine Kaliber",);
|
||||
menu.AddItem(pistolItem);
|
||||
menu.BindMenuToItem(getWeaponsFromCategory(menu, c, "Pistolen"),pistolItem);
|
||||
}
|
||||
break;
|
||||
}
|
||||
/*case 9: { //Sonstiges (Armor / Fallschirm)
|
||||
var otherItem = new MenuItem("Sonstiges", "Schutzwesten, Fallschirme...",);
|
||||
menu.AddItem(otherItem);
|
||||
menu.BindMenuToItem(getWeaponsFromCategory(menu, c, "Sonstiges"), otherItem);
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
menu.Open();
|
||||
mp.gui.chat.activate(false);
|
||||
globalData.InMenu = true;
|
||||
|
||||
menu.MenuClose.on(() => {
|
||||
globalData.InMenu = false;
|
||||
mp.gui.chat.show(true);
|
||||
})
|
||||
});
|
||||
|
||||
function getAmmunationMenu(): NativeUI.Menu {
|
||||
return new Menu("", "AMMU NATION - Waffenladen", new Point(0, screenRes.y / 3), "shopui_title_gunclub", "shopui_title_gunclub");
|
||||
}
|
||||
|
||||
function getWeaponsFromCategory(parentMenu: NativeUI.Menu, category: number, categoryName: string): NativeUI.Menu {
|
||||
var categoryMenu = new Menu("", categoryName, new Point(0, screenRes.y / 3), "shopui_title_gunclub", "shopui_title_gunclub");
|
||||
|
||||
categoryMenu.Visible = false;
|
||||
|
||||
var cWeapons: Weapon[] = weapons.filter(w => w.CategoryId == category);
|
||||
|
||||
if (category < 9) { //Weapons aus Datenbank
|
||||
cWeapons.forEach(weapon => {
|
||||
var weaponItem: NativeUI.UIMenuItem = new MenuItem(weapon.WeaponModel, "Du erhältst " + weapon.Ammo + " Munition", [weapon.WeaponModel, weapon.Ammo, weapon.Price]);
|
||||
categoryMenu.AddItem(weaponItem);
|
||||
weaponItem.SetRightLabel("~g~$" + weapon.Price.toString());
|
||||
})
|
||||
} else { //Sonstiges = Schutzwesten / Fallschirme
|
||||
var armorItem = new MenuItem("Schutzweste", "Sch\u00fctzt dich","armor",);
|
||||
categoryMenu.AddItem(armorItem);
|
||||
armorItem.SetRightLabel("~g~$3000");
|
||||
|
||||
var parachuteItem = new MenuItem("Fallschirm", "Flieg damit wohin du willst");
|
||||
categoryMenu.AddItem(parachuteItem);
|
||||
parachuteItem.SetRightLabel("~g~$500");
|
||||
}
|
||||
|
||||
categoryMenu.ItemSelect.on((item: NativeUI.UIMenuItem, index: number) => {
|
||||
mp.events.callRemote("CLIENT:Ammunation_BuyWeapon", item.Data[0], item.Data[1], item.Data[2]); //weaponmodel / ammo / price
|
||||
});
|
||||
|
||||
return categoryMenu;
|
||||
};
|
||||
};
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<html>
|
||||
<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">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let chat =
|
||||
let chat =
|
||||
{
|
||||
size: 0,
|
||||
history_limit: 50,
|
||||
@@ -40,8 +40,6 @@ var chatAPI =
|
||||
let colors = [];
|
||||
let chatElement = "<li>";
|
||||
|
||||
|
||||
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
let colorCheck = `${text[i]}${text[i + 1]}${text[i + 2]}`;
|
||||
|
||||
@@ -66,7 +64,6 @@ var chatAPI =
|
||||
|
||||
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>");
|
||||
|
||||
1277
ReallifeGamemode.Client/assets/chat/js/newMain.js
Normal file
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,15 @@
|
||||
<title>Wanteds</title>
|
||||
|
||||
<style>
|
||||
@font-face { font-family: 'Pricedown'; src: url('package://assets/font/Pricedown.ttf'); }
|
||||
html, body { margin: 0; padding: 0; }
|
||||
@font-face {
|
||||
font-family: 'Pricedown';
|
||||
src: url('package://assets/font/Pricedown.ttf');
|
||||
}
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#wanteds {
|
||||
position: absolute;
|
||||
@@ -23,7 +30,6 @@
|
||||
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);
|
||||
@@ -42,7 +48,7 @@
|
||||
|
||||
<body>
|
||||
<div id="wanteds" style="display: none;">
|
||||
<img src="package://assets/img/wanteds/star.svg"> <span id="wanted-count">10</span>
|
||||
<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>
|
||||
@@ -55,6 +61,39 @@
|
||||
$("#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
|
||||
14
ReallifeGamemode.Client/global.d.ts
vendored
@@ -4,6 +4,7 @@
|
||||
InMenu: boolean,
|
||||
InChat: boolean,
|
||||
LoggedIn: boolean,
|
||||
IsAfk: boolean,
|
||||
}
|
||||
|
||||
declare type AccountData = {
|
||||
@@ -75,3 +76,16 @@ declare type FactionMember = {
|
||||
declare type FactionRank = {
|
||||
|
||||
}
|
||||
|
||||
declare type Weapon = {
|
||||
WeaponModel: string;
|
||||
CategoryId: number;
|
||||
SlotID: number;
|
||||
Ammo: number;
|
||||
Price: number;
|
||||
}
|
||||
|
||||
declare type WeaponCategory = {
|
||||
Category: number;
|
||||
Weapons: Weapon[];
|
||||
}
|
||||
@@ -14,6 +14,7 @@ let globalData: IGlobalData = {
|
||||
HideGui: false,
|
||||
InChat: false,
|
||||
LoggedIn: false,
|
||||
IsAfk: false,
|
||||
|
||||
get InMenu(): boolean {
|
||||
return inMenu;
|
||||
@@ -258,6 +259,12 @@ animationSync();
|
||||
import antiCheat from './admin/anticheat';
|
||||
antiCheat(globalData);
|
||||
|
||||
import antiAfk from './Player/antiafk';
|
||||
antiAfk(globalData);
|
||||
|
||||
import ammunation from './Interaction/ammunation/ammunation';
|
||||
ammunation(globalData);
|
||||
|
||||
require('./Gui/policedepartment');
|
||||
require('./Gui/helptext');
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
var offerItemArr;
|
||||
var tradeItemArr;
|
||||
var vehItemArr;
|
||||
var trunkSize;
|
||||
|
||||
var loaded = false;
|
||||
|
||||
@@ -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", () => {
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
25
ReallifeGamemode.Database/Entities/UserWeapon.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Database.Entities
|
||||
{
|
||||
public partial class UserWeapon
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[ForeignKey("User")]
|
||||
public int UserId { get; set; }
|
||||
public User User { get; set; }
|
||||
|
||||
[ForeignKey("Weapon")]
|
||||
public int WeaponId { get; set; }
|
||||
public Weapon Weapon { get; set; }
|
||||
|
||||
public int Ammo { get; set; }
|
||||
}
|
||||
}
|
||||
26
ReallifeGamemode.Database/Entities/Weapon.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Database.Entities
|
||||
{
|
||||
public partial class Weapon
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string WeaponModel { get; set; }
|
||||
[ForeignKey("WeaponCategory")]
|
||||
public int CategoryId { get; set; }
|
||||
public WeaponCategory WeaponCategory { get; set; }
|
||||
public int SlotID { get; set; }
|
||||
public int Ammo { get; set; }
|
||||
public float Price { get; set; }
|
||||
|
||||
public bool Legal { get; set; }
|
||||
public bool AmmunationActive { get; set; }
|
||||
}
|
||||
}
|
||||
17
ReallifeGamemode.Database/Entities/WeaponCategory.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Database.Entities
|
||||
{
|
||||
public partial class WeaponCategory
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
public string Category { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
1975
ReallifeGamemode.Database/Migrations/20210413201146_Ammunations.Designer.cs
generated
Normal file
@@ -0,0 +1,101 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
public partial class Ammunations : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "WeaponCategories",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Category = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_WeaponCategories", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Weapons",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
WeaponModel = table.Column<string>(nullable: true),
|
||||
CategoryId = table.Column<int>(nullable: false),
|
||||
SlotID = table.Column<int>(nullable: false),
|
||||
Ammo = table.Column<int>(nullable: false),
|
||||
Price = table.Column<float>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Weapons", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Weapons_WeaponCategories_CategoryId",
|
||||
column: x => x.CategoryId,
|
||||
principalTable: "WeaponCategories",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserWeapons",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
UserId = table.Column<int>(nullable: false),
|
||||
WeaponId = table.Column<int>(nullable: false),
|
||||
Ammo = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserWeapons", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserWeapons_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserWeapons_Weapons_WeaponId",
|
||||
column: x => x.WeaponId,
|
||||
principalTable: "Weapons",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserWeapons_UserId",
|
||||
table: "UserWeapons",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserWeapons_WeaponId",
|
||||
table: "UserWeapons",
|
||||
column: "WeaponId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Weapons_CategoryId",
|
||||
table: "Weapons",
|
||||
column: "CategoryId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "UserWeapons");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Weapons");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "WeaponCategories");
|
||||
}
|
||||
}
|
||||
}
|
||||
1981
ReallifeGamemode.Database/Migrations/20210416175726_Ammunations2.Designer.cs
generated
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ReallifeGamemode.Database.Migrations
|
||||
{
|
||||
public partial class Ammunations2 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AmmunationActive",
|
||||
table: "Weapons",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Legal",
|
||||
table: "Weapons",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AmmunationActive",
|
||||
table: "Weapons");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Legal",
|
||||
table: "Weapons");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1519,6 +1519,30 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
b.ToTable("UserItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserWeapon", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Ammo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("WeaponId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("WeaponId");
|
||||
|
||||
b.ToTable("UserWeapons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1567,6 +1591,54 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
b.ToTable("VehicleMods");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Weapon", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Ammo")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("AmmunationActive")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int>("CategoryId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("Legal")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<float>("Price")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<int>("SlotID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("WeaponModel")
|
||||
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CategoryId");
|
||||
|
||||
b.ToTable("Weapons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.WeaponCategory", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Category")
|
||||
.HasColumnType("longtext CHARACTER SET utf8mb4");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("WeaponCategories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Whitelist", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1844,6 +1916,21 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserWeapon", b =>
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Database.Entities.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ReallifeGamemode.Database.Entities.Weapon", "Weapon")
|
||||
.WithMany()
|
||||
.HasForeignKey("WeaponId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b =>
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Database.Entities.ServerVehicle", "Vehicle")
|
||||
@@ -1862,6 +1949,15 @@ namespace ReallifeGamemode.Database.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Weapon", b =>
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Database.Entities.WeaponCategory", "WeaponCategory")
|
||||
.WithMany()
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b =>
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group")
|
||||
|
||||
@@ -74,6 +74,8 @@ namespace ReallifeGamemode.Database.Models
|
||||
public DbSet<Entities.UserVehicle> UserVehicles { get; set; }
|
||||
public DbSet<Entities.UserBankAccount> UserBankAccounts { get; set; }
|
||||
|
||||
public DbSet<Entities.UserWeapon> UserWeapons { get; set; }
|
||||
|
||||
|
||||
//Inventar
|
||||
public DbSet<Entities.UserItem> UserItems { get; set; }
|
||||
@@ -85,8 +87,13 @@ namespace ReallifeGamemode.Database.Models
|
||||
public DbSet<Entities.FactionVehicle> FactionVehicles { get; set; }
|
||||
|
||||
//Shops
|
||||
public DbSet<Entities.ShopClothe> ShopClothes { get; set; }
|
||||
public DbSet<Entities.ShopItem> ShopItems { get; set; }
|
||||
public DbSet<Entities.Weapon> Weapons { get; set; }
|
||||
public DbSet<Entities.WeaponCategory> WeaponCategories { get; set; }
|
||||
|
||||
//Logs
|
||||
|
||||
//public DbSet<Logs.Ban> BanLogs { get; set; }
|
||||
public DbSet<Entities.Logs.BankAccountTransactionHistory> BankAccountTransactionLogs { get; set; }
|
||||
public DbSet<Entities.Logs.Death> DeathLogs { get; set; }
|
||||
@@ -155,12 +162,6 @@ namespace ReallifeGamemode.Database.Models
|
||||
//Gangwar
|
||||
public DbSet<Entities.Turfs> Turfs { get; set; }
|
||||
|
||||
//ClothesShop
|
||||
public DbSet<Entities.ShopClothe> ShopClothes { get; set; }
|
||||
|
||||
//ItemShop
|
||||
public DbSet<Entities.ShopItem> ShopItems { get; set; }
|
||||
|
||||
//Server Variablen
|
||||
public DbSet<Entities.ServerVariable> ServerVariables { get; set; }
|
||||
}
|
||||
|
||||
43
ReallifeGamemode.Database/sql
Normal file
@@ -0,0 +1,43 @@
|
||||
CREATE TABLE `WeaponCategories` (
|
||||
`Id` int NOT NULL AUTO_INCREMENT,
|
||||
`Category` longtext CHARACTER SET utf8mb4 NULL,
|
||||
CONSTRAINT `PK_WeaponCategories` PRIMARY KEY (`Id`)
|
||||
);
|
||||
|
||||
CREATE TABLE `Weapons` (
|
||||
`Id` int NOT NULL AUTO_INCREMENT,
|
||||
`WeaponModel` longtext CHARACTER SET utf8mb4 NULL,
|
||||
`CategoryId` int NOT NULL,
|
||||
`SlotID` int NOT NULL,
|
||||
`Ammo` int NOT NULL,
|
||||
`Price` float NOT NULL,
|
||||
CONSTRAINT `PK_Weapons` PRIMARY KEY (`Id`),
|
||||
CONSTRAINT `FK_Weapons_WeaponCategories_CategoryId` FOREIGN KEY (`CategoryId`) REFERENCES `WeaponCategories` (`Id`) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE `UserWeapons` (
|
||||
`Id` int NOT NULL AUTO_INCREMENT,
|
||||
`UserId` int NOT NULL,
|
||||
`WeaponId` int NOT NULL,
|
||||
`Ammo` int NOT NULL,
|
||||
CONSTRAINT `PK_UserWeapons` PRIMARY KEY (`Id`),
|
||||
CONSTRAINT `FK_UserWeapons_Users_UserId` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `FK_UserWeapons_Weapons_WeaponId` FOREIGN KEY (`WeaponId`) REFERENCES `Weapons` (`Id`) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE INDEX `IX_UserWeapons_UserId` ON `UserWeapons` (`UserId`);
|
||||
|
||||
CREATE INDEX `IX_UserWeapons_WeaponId` ON `UserWeapons` (`WeaponId`);
|
||||
|
||||
CREATE INDEX `IX_Weapons_CategoryId` ON `Weapons` (`CategoryId`);
|
||||
|
||||
INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
|
||||
VALUES ('20210413201146_Ammunations', '3.1.3');
|
||||
|
||||
ALTER TABLE `Weapons` ADD `AmmunationActive` tinyint(1) NOT NULL DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE `Weapons` ADD `Legal` tinyint(1) NOT NULL DEFAULT FALSE;
|
||||
|
||||
INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
|
||||
VALUES ('20210416175726_Ammunations2', '3.1.3');
|
||||
|
||||
@@ -61,9 +61,9 @@ namespace ReallifeGamemode.Server.Core.Menus
|
||||
|
||||
private void CreateVisuals()
|
||||
{
|
||||
Position pos = new Position(440.869, -981.045, 30.689);
|
||||
Position pos = new Position(12.7499, -1105.1168, 29.797);
|
||||
|
||||
Api.TextLabel.CreateTextLabel("Polizeirevier\n\nDrücke ~y~E~s~, um das Menü zu öffnen", pos, 20f, 1.3f, Font.ChaletLondon, Color.White);
|
||||
Api.TextLabel.CreateTextLabel("Waffenschein kaufen\n\nDrücke ~y~E~s~, um das Menü zu öffnen", pos, 20f, 1.3f, Font.ChaletLondon, Color.White);
|
||||
Api.Marker.CreateMarker(MarkerType.VerticalCylinder, pos.Subtract(new Position(0, 0, 1.7)), new Position(), new Position(), 1f, Color.White);
|
||||
IColShape colShape = Api.ColShape.CreateSphere(pos, 2f);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace ReallifeGamemode.Server.Business
|
||||
{
|
||||
public override int Id => 8;
|
||||
|
||||
public override string Name => "Motorrad Shop";
|
||||
public override string Name => "Bike Shop";
|
||||
|
||||
public override Vector3 Position => new Vector3(1180.997, -394.9542, 68.01635);
|
||||
|
||||
|
||||
25
ReallifeGamemode.Server/Business/ClassicAndLuxuryCarshop.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Business
|
||||
{
|
||||
class ClassicAndLuxuryCarshop : CarDealerBusinessBase
|
||||
{
|
||||
public override int Id => 13;
|
||||
|
||||
public override string Name => "Classic & Luxury Carshop";
|
||||
|
||||
public override Vector3 Position => new Vector3(-1274.3439, 315.1384, 65.51176);
|
||||
|
||||
public override Vector3 CarSpawnPositon => new Vector3(-1351.2072, 244.88942, 60.357693);
|
||||
|
||||
public override float CarSpawnHeading => 3.62f;
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
25
ReallifeGamemode.Server/Business/OldschoolCarshop.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Business
|
||||
{
|
||||
class OldschoolCarshop : CarDealerBusinessBase
|
||||
{
|
||||
public override int Id => 14;
|
||||
|
||||
public override string Name => "Oldschool Carshop";
|
||||
|
||||
public override Vector3 Position => new Vector3(-1888.1119, 2049.722, 140.9831);
|
||||
|
||||
public override Vector3 CarSpawnPositon => new Vector3(-1883.5817, 2029.6252, 140.55038);
|
||||
|
||||
public override float CarSpawnHeading => 163.73f;
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace ReallifeGamemode.Server.Business
|
||||
{
|
||||
public override int Id => 3;
|
||||
|
||||
public override string Name => "Vapid Autohaus";
|
||||
public override string Name => "Vapid Carshop";
|
||||
|
||||
public override Vector3 Position => new Vector3(-177, -1156, 23);
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -281,6 +226,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
player.SendNotification("~g~[Info]~w~ Leaderchat wird nun angezeigt.");
|
||||
}
|
||||
break;
|
||||
|
||||
case "connect":
|
||||
if (player.HasData("togconnect"))
|
||||
{
|
||||
@@ -1339,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.");
|
||||
@@ -1450,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())
|
||||
{
|
||||
@@ -2024,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.");
|
||||
}
|
||||
@@ -2304,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)
|
||||
{
|
||||
@@ -413,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}");
|
||||
});
|
||||
|
||||
@@ -153,6 +153,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
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);
|
||||
|
||||
player.ClearAnimation();
|
||||
|
||||
dbContext.Remove(item);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -48,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))
|
||||
@@ -60,6 +62,19 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
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();
|
||||
@@ -131,6 +146,32 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
List<UserItem> fItem = saveUser.UserItems.Where(u => u.UserId == user.Id).ToList();
|
||||
|
||||
foreach (var item in fItem)
|
||||
{
|
||||
IItem iItem = InventoryManager.GetItemById(item.ItemId);
|
||||
if (iItem is IWeaponDealItem obj)
|
||||
{
|
||||
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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -235,6 +235,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6);
|
||||
Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData<bool>("duty"));
|
||||
AmmunationPoint nearestAmmunationPoint = PositionManager.AmmunationPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5);
|
||||
|
||||
if (user?.FactionId != null)
|
||||
{
|
||||
@@ -516,6 +517,17 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
nearestFriseurPoint.friseurShop.LoadShopNUI(player);
|
||||
}
|
||||
if (nearestAmmunationPoint != null)
|
||||
{
|
||||
if (!user.WeaponLicense)
|
||||
{
|
||||
player.SendNotification("~r~Du besitzt keinen Waffenschein");
|
||||
}
|
||||
else
|
||||
{
|
||||
nearestAmmunationPoint.Ammunation.LoadShopNUI(player);
|
||||
}
|
||||
}
|
||||
if (user.FactionLeader)
|
||||
{
|
||||
player.TriggerEvent("CLIENT:StartGangwar");
|
||||
|
||||
@@ -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)
|
||||
@@ -148,6 +150,19 @@ namespace ReallifeGamemode.Server.Events
|
||||
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);
|
||||
NAPI.Task.Run(() =>
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,5 +118,24 @@ namespace ReallifeGamemode.Server.Events
|
||||
context.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:Ammunation_BuyWeapon")]
|
||||
public void AmmunationBuyWeapoon(Player player, string weaponmodel, int ammo, int price)
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User user = player.GetUser(dbContext);
|
||||
|
||||
if (user.Handmoney < price)
|
||||
{
|
||||
player.SendNotification("Du hast nicht genügend Geld bei dir");
|
||||
return;
|
||||
}
|
||||
user.Handmoney -= price;
|
||||
dbContext.SaveChanges();
|
||||
player.GiveWeapon(NAPI.Util.WeaponNameToModel(weaponmodel), ammo);
|
||||
//client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
return;
|
||||
}
|
||||
|
||||
int time = 26 * user.Wanteds;
|
||||
int time = 18 * user.Wanteds;
|
||||
if (killed)
|
||||
{
|
||||
time *= 2;
|
||||
@@ -136,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;
|
||||
|
||||
@@ -17,5 +17,115 @@ 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.Model == VehicleHash.Moonbeam
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Moonbeam2
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Ratloader
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Ratloader2
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Slamvan
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Slamvan2
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Slamvan3
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Yosemite
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Yosemite2
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Picador)
|
||||
return 250 * 1000;
|
||||
else
|
||||
return 180 * 1000;
|
||||
|
||||
case 5:
|
||||
if ((VehicleHash)vehicle.Model == VehicleHash.Fagaloa
|
||||
|| (VehicleHash)vehicle.Model == 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.Model == VehicleHash.Bifta
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Blazer
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Blazer2
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Blazer3
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Blazer4
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Blazer5)
|
||||
return 30 * 1000;
|
||||
else
|
||||
return 300 * 1000;
|
||||
|
||||
case 10:
|
||||
return 2500 * 1000;
|
||||
|
||||
case 11:
|
||||
return 0;
|
||||
|
||||
case 12:
|
||||
if ((VehicleHash)vehicle.Model == VehicleHash.Minivan
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Minivan2
|
||||
|| (VehicleHash)vehicle.Model == 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.Model == VehicleHash.Policet)
|
||||
return 1000 * 1000;
|
||||
else if ((VehicleHash)vehicle.Model == VehicleHash.Firetruk
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Pbus
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Policeb
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Polmav
|
||||
|| (VehicleHash)vehicle.Model == VehicleHash.Predator)
|
||||
return 0;
|
||||
else
|
||||
return 150 * 1000;
|
||||
|
||||
case 19:
|
||||
return 0;
|
||||
|
||||
case 20:
|
||||
return 2500 * 1000;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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 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 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";
|
||||
@@ -195,25 +195,16 @@ namespace ReallifeGamemode.Server.Job
|
||||
{ 0,
|
||||
new List<Vector3>()
|
||||
{
|
||||
//new Vector3(-601.733, -2049.285, 6.090),
|
||||
//new Vector3(-598.849365234375, -2053.087646484375, 5.8428778648376465),
|
||||
new Vector3(-229.679931640625, -2049.821533203125, 27.384798049926758),
|
||||
new Vector3(-72.33480834960938, -615.8173217773438, 35.91234588623047),
|
||||
new Vector3(-176.9166717529297, -153.85665893554688, 43.38493728637695),
|
||||
new Vector3(-508.5746765136719, -261.1121826171875, 35.247962951660156),
|
||||
new Vector3(-1396.5457763671875, 51.69581604003906, 53.21350860595703),
|
||||
new Vector3(-1911.845458984375, 205.62884521484375, 84.06185150146484),
|
||||
new Vector3(-1675.4029541015625, 488.7856140136719, 128.6395721435547),
|
||||
new Vector3(-995.8155517578125, 589.4381713867188, 102.18698120117188),
|
||||
new Vector3(-314.6571350097656, 451.9184875488281, 107.99801635742188),
|
||||
new Vector3(211.09194946289062, 350.1848449707031, 105.41163635253906),
|
||||
new Vector3(599.4515380859375, 626.0756225585938, 128.6754608154297),
|
||||
new Vector3(969.324462890625, 164.03329467773438, 80.59388732910156),
|
||||
new Vector3(1069.521240234375, -763.7572631835938, 57.43597412109375),
|
||||
new Vector3(1421.075927734375, -1854.2821044921875, 70.56175994873047),
|
||||
new Vector3(268.5604248046875, -2070.274169921875, 16.816179275512695),
|
||||
new Vector3(-147.51795959472656, -1974.3182373046875, 22.48438262939453),
|
||||
new Vector3(-569.0294189453125, -2210.80908203125, 5.571292877197266),
|
||||
new Vector3(-146.62071, -2178.8228, 10.194298),
|
||||
new Vector3(14.580393, -1578.6385, 29.212185),
|
||||
new Vector3(222.91612, -1098.8556, 29.227453),
|
||||
new Vector3(246.44946, -648.45496, 39.420746),
|
||||
new Vector3(102.181, -298.95276, 46.04399),
|
||||
new Vector3(-104.91002, -606.26013, 36.06103),
|
||||
new Vector3(-288.1007, -1204.5107, 24.403156),
|
||||
new Vector3(-166.23526, -1574.4166, 35.152023),
|
||||
new Vector3(-60.337997, -1976.121, 16.486664),
|
||||
new Vector3(-599.1891, -2049.2695, 6.14637),
|
||||
}
|
||||
},
|
||||
{ 1,
|
||||
@@ -238,16 +229,15 @@ namespace ReallifeGamemode.Server.Job
|
||||
new List<Vector3>()
|
||||
{
|
||||
//new Vector3(-601.733, -2049.285, 6.090),
|
||||
new Vector3(-146.62071, -2178.8228, 9.194298),
|
||||
new Vector3(14.580393, -1578.6385, 28.212185),
|
||||
new Vector3(222.91612, -1098.8556, 28.227453),
|
||||
new Vector3(246.44946, -648.45496, 38.420746),
|
||||
new Vector3(102.181, -298.95276, 45.04399),
|
||||
new Vector3(-104.91002, -606.26013, 35.06103),
|
||||
new Vector3(-288.1007, -1204.5107, 23.403156),
|
||||
new Vector3(-166.23526, -1574.4166, 34.152023),
|
||||
new Vector3(-60.337997, -1976.121, 15.486664),
|
||||
new Vector3(-599.1891, -2049.2695, 5.14637),
|
||||
new Vector3(-566.381, -2209.74, 5.88064),
|
||||
new Vector3(769.912, -1983.54, 29.2573),
|
||||
new Vector3(1021.58, -725.525, 57.6664),
|
||||
new Vector3(244.279, -860.634, 29.5133),
|
||||
new Vector3(-506.147, -282.95, 35.4909),
|
||||
new Vector3(-1205.3, -130.106, 40.9405),
|
||||
new Vector3(-1396.98, -773.447, 20.68),
|
||||
new Vector3(-666.861, -1241.26, 10.5494),
|
||||
new Vector3(-599.541, -2054.42, 6.0372),
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -345,8 +335,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 +433,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 +464,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;
|
||||
@@ -587,7 +585,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(() =>
|
||||
{
|
||||
@@ -625,7 +623,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);
|
||||
@@ -645,8 +643,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,6 @@ namespace ReallifeGamemode.Server.Job
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (JobManager.playerTimersJobVehicleRespawn.ContainsKey(player))
|
||||
{
|
||||
JobManager.playerTimersJobVehicleRespawn[player].Stop();
|
||||
@@ -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(() =>
|
||||
{
|
||||
|
||||
@@ -440,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(() =>
|
||||
{
|
||||
|
||||
@@ -122,6 +122,7 @@ namespace ReallifeGamemode.Server
|
||||
ShopManager.LoadClotheShops();
|
||||
ShopManager.LoadItemShops();
|
||||
ShopManager.LoadFriseur();
|
||||
ShopManager.LoadAmmunations();
|
||||
TuningManager.LoadTuningGarages();
|
||||
|
||||
TimeManager.StartTimeManager();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,11 +529,13 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
if (iItem is IUsableItem usableItemObj)
|
||||
{
|
||||
usableItemObj.Use(fItem);
|
||||
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;
|
||||
|
||||
@@ -561,6 +563,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
if (iItem is IWeaponDealItem obj)
|
||||
{
|
||||
player.ClearAttachments();
|
||||
player.ClearAnimation();
|
||||
dropPosition.Z -= 1.05f;
|
||||
grndObject = NAPI.Object.CreateObject(3666746839, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 255, 0);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using ReallifeGamemode.Server.Shop.SevenEleven;
|
||||
using ReallifeGamemode.Server.Shop.Friseur;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Shop.Ammunation;
|
||||
|
||||
namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
@@ -29,6 +30,8 @@ namespace ReallifeGamemode.Server.Managers
|
||||
|
||||
public static List<Player> cuffPoints = new List<Player>();
|
||||
|
||||
public static List<AmmunationPoint> AmmunationPoints = new List<AmmunationPoint>();
|
||||
|
||||
public static void LoadPositionManager()
|
||||
{
|
||||
#region DutyPoints
|
||||
@@ -280,6 +283,20 @@ namespace ReallifeGamemode.Server.Managers
|
||||
NAPI.TextLabel.CreateTextLabel("24/7 - Dr\u00fccke ~y~E", s.Position, 7, 1, 0, new Color(255, 255, 255), false, 0);
|
||||
}
|
||||
|
||||
foreach (Ammunation s in ShopManager.Ammunations)
|
||||
{
|
||||
NAPI.Marker.CreateMarker(1, new Vector3(s.vector.X, s.vector.Y, s.vector.Z - 2), new Vector3(s.vector.X, s.vector.Y, s.vector.Z + 1),
|
||||
new Vector3(0, 0, 0), 2, new Color(255, 255, 255, 50), false, 0);
|
||||
NAPI.TextLabel.CreateTextLabel("Ammunation - Dr\u00fccke ~y~E", s.vector, 7, 1, 0, new Color(255, 255, 255), false, 0);
|
||||
|
||||
AmmunationPoint ammuShop = new AmmunationPoint
|
||||
{
|
||||
Position = s.vector,
|
||||
Ammunation = s
|
||||
};
|
||||
AmmunationPoints.Add(ammuShop);
|
||||
}
|
||||
|
||||
#endregion Shops
|
||||
}
|
||||
|
||||
@@ -407,3 +424,9 @@ public class ElevatorPoint
|
||||
public int FactionId { get; set; }
|
||||
public string Stage { get; set; }
|
||||
}
|
||||
|
||||
public class AmmunationPoint
|
||||
{
|
||||
public Vector3 Position { get; set; }
|
||||
public Ammunation Ammunation { get; set; }
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using ReallifeGamemode.Database.Models;
|
||||
using ReallifeGamemode.Server.Shop.Clothing;
|
||||
using ReallifeGamemode.Server.Shop.SevenEleven;
|
||||
using ReallifeGamemode.Server.Shop.Friseur;
|
||||
using ReallifeGamemode.Server.Shop.Ammunation;
|
||||
|
||||
namespace ReallifeGamemode.Server.Managers
|
||||
{
|
||||
@@ -14,6 +15,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
public static List<ClotheShop> clotheStores = new List<ClotheShop>();
|
||||
public static List<ItemShop> itemShops = new List<ItemShop>();
|
||||
public static List<Friseur> FriseurStores = new List<Friseur>();
|
||||
public static List<Ammunation> Ammunations = new List<Ammunation>();
|
||||
|
||||
public static void LoadClotheShops()
|
||||
{
|
||||
@@ -81,5 +83,20 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadAmmunations()
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
List<SavedBlip> ammunations = dbContext.Blips.ToList().FindAll(s => s.Name == "Ammunation");
|
||||
|
||||
foreach (var store in ammunations)
|
||||
{
|
||||
Vector3 pos = new Vector3(store.PositionX, store.PositionY, store.PositionZ);
|
||||
Ammunation newShop = new Ammunation(pos);
|
||||
Ammunations.Add(newShop);
|
||||
}
|
||||
NAPI.Util.ConsoleOutput($"Loading {ammunations.Count} Ammunations");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
|
||||
@@ -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>();
|
||||
|
||||