[+] Start WeaponDeal-System
This commit is contained in:
@@ -26,16 +26,17 @@ export default function weaponList(globalData: GlobalData) {
|
|||||||
var secondaries;
|
var secondaries;
|
||||||
var melees;
|
var melees;
|
||||||
var specialsWep;
|
var specialsWep;
|
||||||
|
var time;
|
||||||
|
|
||||||
var primary = "";
|
var primary = "";
|
||||||
var secondary = "";
|
var secondary = "";
|
||||||
var melee = "";
|
var melee = "";
|
||||||
var specialWep = "";
|
var specialWep = "";
|
||||||
|
var timer = "";
|
||||||
|
|
||||||
//Weapon Menu
|
//Weapon Menu
|
||||||
|
|
||||||
mp.events.add('showWeaponMenu', (primariesArr, secondariesArr, meleesArr, specialsArr) => {
|
mp.events.add('showWeaponMenu', (primariesArr, secondariesArr, meleesArr, specialsArr, jsonTime) => {
|
||||||
if (!globalData.InMenu) {
|
if (!globalData.InMenu) {
|
||||||
|
|
||||||
globalData.InMenu = true;
|
globalData.InMenu = true;
|
||||||
@@ -44,13 +45,19 @@ export default function weaponList(globalData: GlobalData) {
|
|||||||
secondaries = secondariesArr;
|
secondaries = secondariesArr;
|
||||||
melees = meleesArr;
|
melees = meleesArr;
|
||||||
specialsWep = specialsArr;
|
specialsWep = specialsArr;
|
||||||
|
time = JSON.parse(jsonTime);
|
||||||
|
|
||||||
weaponMenu = new Menu("Waffenschrank", "Stelle deine Waffen Ausrüstung zusammen", new Point(50, 50), null, null);
|
let dealItem = new UIMenuListItem("Waffentransport", "", new ItemsCollection(time));
|
||||||
|
dealItem.BackColor = new Color(204, 170, 0);
|
||||||
|
dealItem.HighlightedBackColor = new Color(255, 213, 0);
|
||||||
|
|
||||||
weaponMenu.AddItem(new UIMenuListItem("Primäre", "", new ItemsCollection(primaries)));
|
weaponMenu = new Menu("Waffenschrank", "Stelle deine Waffenausrüstung zusammen", new Point(50, 50), null, null);
|
||||||
weaponMenu.AddItem(new UIMenuListItem("Sekundäre", "", new ItemsCollection(secondaries)));
|
|
||||||
|
weaponMenu.AddItem(new UIMenuListItem("Primäre", "", new ItemsCollection(secondaries)));
|
||||||
|
weaponMenu.AddItem(new UIMenuListItem("Sekundäre", "", new ItemsCollection(primaries)));
|
||||||
weaponMenu.AddItem(new UIMenuListItem("Nahkampf", "", new ItemsCollection(melees)));
|
weaponMenu.AddItem(new UIMenuListItem("Nahkampf", "", new ItemsCollection(melees)));
|
||||||
weaponMenu.AddItem(new UIMenuListItem("Spezial", "", new ItemsCollection(specialsWep)));
|
weaponMenu.AddItem(new UIMenuListItem("Spezial", "", new ItemsCollection(specialsWep)));
|
||||||
|
weaponMenu.AddItem(dealItem);
|
||||||
weaponMenu.AddItem(saveItem);
|
weaponMenu.AddItem(saveItem);
|
||||||
weaponMenu.AddItem(cancelItem);
|
weaponMenu.AddItem(cancelItem);
|
||||||
weaponMenu.Visible = true;
|
weaponMenu.Visible = true;
|
||||||
@@ -96,6 +103,10 @@ export default function weaponList(globalData: GlobalData) {
|
|||||||
} else if (item.Text === "Abbrechen") {
|
} else if (item.Text === "Abbrechen") {
|
||||||
weaponMenu.Close();
|
weaponMenu.Close();
|
||||||
globalData.InMenu = false;
|
globalData.InMenu = false;
|
||||||
|
} else if (item.Text === "Waffentransport") {
|
||||||
|
mp.events.callRemote("startWeaponDeal");
|
||||||
|
weaponMenu.Close();
|
||||||
|
globalData.InMenu = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg height="504pt" viewBox="0 -71 504 503" width="504pt" xmlns="http://www.w3.org/2000/svg"><path d="m388 56.5h-60v304h120v-304zm0 0" fill="#656d78"/><path d="m304 80.5h-280v256h280zm24-24v304h-328v-304zm0 0" fill="#ffd2a6"/><path d="m300 80.5c2.199219 0 4 1.800781 4 4v248c0 2.199219-1.800781 4-4 4h-272c-2.199219 0-4-1.800781-4-4v-248c0-2.199219 1.800781-4 4-4zm0 0" fill="#ed5565"/><path d="m56 .5h328l-56 56h-328zm0 0" fill="#f2c397"/><path d="m448 56.5h-24l56-56h24zm0 0" fill="#ccd1d9"/><path d="m480 .5-56 56h-96l56-56zm0 0" fill="#ccd1d9"/><path d="m504 .5v304l-56 56v-304zm0 0" fill="#e6e9ed"/><path d="m276 104.5c2.199219 0 4 1.800781 4 4v24c0 2.199219-1.800781 4-4 4h-224c-2.199219 0-4-1.800781-4-4v-24c0-2.199219 1.800781-4 4-4zm0 0" fill="#656d78"/><path d="m267.328125 214.292969c-.703125-1.058594-17.761719-25.785157-67.328125-25.792969-1.0625 0-2.078125.425781-2.832031 1.167969-.753907.742187-1.167969 1.769531-1.167969 2.832031v48.015625c0 2.207031 1.792969 4 4 4 49.566406 0 66.625-24.734375 67.328125-25.792969.894531-1.34375.894531-3.085937 0-4.429687zm0 0" fill="#ffce54"/><g fill="#f5f7fa"><path d="m184.238281 228.5c-2.207031 0-4.039062-1.792969-4.039062-4s1.753906-4 3.960937-4h.085938c2.203125 0 4 1.792969 4 4s-1.796875 4-4.007813 4zm0 0"/><path d="m184 244.507812h-72c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0"/><path d="m184 212.5h-56c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h56c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m168 228.5h-88c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h88c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m184 196.5h-16c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h16c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm-32 0h-96c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h96c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m112 212.5h-8c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h8c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/></g><path d="m383.984375 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m359.984375 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m379.984375 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m359.984375 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m440.015625 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m416.015625 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m436.015625 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m416.015625 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m239.984375 124.5h-151.96875c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h151.96875c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#545c66"/><path d="m256 300.5h-184c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h184c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m200 316.5h-72c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m308 40.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/><path d="m324 24.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/></svg>
|
||||||
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg height="504pt" viewBox="0 -71 504 503" width="504pt" xmlns="http://www.w3.org/2000/svg"><path d="m388 56.5h-60v304h120v-304zm0 0" fill="#656d78"/><path d="m304 80.5h-280v256h280zm24-24v304h-328v-304zm0 0" fill="#ffd2a6"/><path d="m300 80.5c2.199219 0 4 1.800781 4 4v248c0 2.199219-1.800781 4-4 4h-272c-2.199219 0-4-1.800781-4-4v-248c0-2.199219 1.800781-4 4-4zm0 0" fill="#ed5565"/><path d="m56 .5h328l-56 56h-328zm0 0" fill="#f2c397"/><path d="m448 56.5h-24l56-56h24zm0 0" fill="#ccd1d9"/><path d="m480 .5-56 56h-96l56-56zm0 0" fill="#ccd1d9"/><path d="m504 .5v304l-56 56v-304zm0 0" fill="#e6e9ed"/><path d="m276 104.5c2.199219 0 4 1.800781 4 4v24c0 2.199219-1.800781 4-4 4h-224c-2.199219 0-4-1.800781-4-4v-24c0-2.199219 1.800781-4 4-4zm0 0" fill="#656d78"/><path d="m267.328125 214.292969c-.703125-1.058594-17.761719-25.785157-67.328125-25.792969-1.0625 0-2.078125.425781-2.832031 1.167969-.753907.742187-1.167969 1.769531-1.167969 2.832031v48.015625c0 2.207031 1.792969 4 4 4 49.566406 0 66.625-24.734375 67.328125-25.792969.894531-1.34375.894531-3.085937 0-4.429687zm0 0" fill="#ffce54"/><g fill="#f5f7fa"><path d="m184.238281 228.5c-2.207031 0-4.039062-1.792969-4.039062-4s1.753906-4 3.960937-4h.085938c2.203125 0 4 1.792969 4 4s-1.796875 4-4.007813 4zm0 0"/><path d="m184 244.507812h-72c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0"/><path d="m184 212.5h-56c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h56c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m168 228.5h-88c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h88c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m184 196.5h-16c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h16c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm-32 0h-96c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h96c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m112 212.5h-8c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h8c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/></g><path d="m383.984375 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m359.984375 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m379.984375 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m359.984375 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m440.015625 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m416.015625 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m436.015625 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m416.015625 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m239.984375 124.5h-151.96875c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h151.96875c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#545c66"/><path d="m256 300.5h-184c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h184c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m200 316.5h-72c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m308 40.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/><path d="m324 24.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/></svg>
|
||||||
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg height="504pt" viewBox="0 -71 504 503" width="504pt" xmlns="http://www.w3.org/2000/svg"><path d="m388 56.5h-60v304h120v-304zm0 0" fill="#656d78"/><path d="m304 80.5h-280v256h280zm24-24v304h-328v-304zm0 0" fill="#ffd2a6"/><path d="m300 80.5c2.199219 0 4 1.800781 4 4v248c0 2.199219-1.800781 4-4 4h-272c-2.199219 0-4-1.800781-4-4v-248c0-2.199219 1.800781-4 4-4zm0 0" fill="#ed5565"/><path d="m56 .5h328l-56 56h-328zm0 0" fill="#f2c397"/><path d="m448 56.5h-24l56-56h24zm0 0" fill="#ccd1d9"/><path d="m480 .5-56 56h-96l56-56zm0 0" fill="#ccd1d9"/><path d="m504 .5v304l-56 56v-304zm0 0" fill="#e6e9ed"/><path d="m276 104.5c2.199219 0 4 1.800781 4 4v24c0 2.199219-1.800781 4-4 4h-224c-2.199219 0-4-1.800781-4-4v-24c0-2.199219 1.800781-4 4-4zm0 0" fill="#656d78"/><path d="m267.328125 214.292969c-.703125-1.058594-17.761719-25.785157-67.328125-25.792969-1.0625 0-2.078125.425781-2.832031 1.167969-.753907.742187-1.167969 1.769531-1.167969 2.832031v48.015625c0 2.207031 1.792969 4 4 4 49.566406 0 66.625-24.734375 67.328125-25.792969.894531-1.34375.894531-3.085937 0-4.429687zm0 0" fill="#ffce54"/><g fill="#f5f7fa"><path d="m184.238281 228.5c-2.207031 0-4.039062-1.792969-4.039062-4s1.753906-4 3.960937-4h.085938c2.203125 0 4 1.792969 4 4s-1.796875 4-4.007813 4zm0 0"/><path d="m184 244.507812h-72c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0"/><path d="m184 212.5h-56c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h56c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m168 228.5h-88c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h88c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m184 196.5h-16c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h16c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm-32 0h-96c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h96c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m112 212.5h-8c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h8c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/></g><path d="m383.984375 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m359.984375 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m379.984375 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m359.984375 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m440.015625 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m416.015625 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m436.015625 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m416.015625 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m239.984375 124.5h-151.96875c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h151.96875c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#545c66"/><path d="m256 300.5h-184c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h184c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m200 316.5h-72c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m308 40.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/><path d="m324 24.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/></svg>
|
||||||
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg height="504pt" viewBox="0 -71 504 503" width="504pt" xmlns="http://www.w3.org/2000/svg"><path d="m388 56.5h-60v304h120v-304zm0 0" fill="#656d78"/><path d="m304 80.5h-280v256h280zm24-24v304h-328v-304zm0 0" fill="#ffd2a6"/><path d="m300 80.5c2.199219 0 4 1.800781 4 4v248c0 2.199219-1.800781 4-4 4h-272c-2.199219 0-4-1.800781-4-4v-248c0-2.199219 1.800781-4 4-4zm0 0" fill="#ed5565"/><path d="m56 .5h328l-56 56h-328zm0 0" fill="#f2c397"/><path d="m448 56.5h-24l56-56h24zm0 0" fill="#ccd1d9"/><path d="m480 .5-56 56h-96l56-56zm0 0" fill="#ccd1d9"/><path d="m504 .5v304l-56 56v-304zm0 0" fill="#e6e9ed"/><path d="m276 104.5c2.199219 0 4 1.800781 4 4v24c0 2.199219-1.800781 4-4 4h-224c-2.199219 0-4-1.800781-4-4v-24c0-2.199219 1.800781-4 4-4zm0 0" fill="#656d78"/><path d="m267.328125 214.292969c-.703125-1.058594-17.761719-25.785157-67.328125-25.792969-1.0625 0-2.078125.425781-2.832031 1.167969-.753907.742187-1.167969 1.769531-1.167969 2.832031v48.015625c0 2.207031 1.792969 4 4 4 49.566406 0 66.625-24.734375 67.328125-25.792969.894531-1.34375.894531-3.085937 0-4.429687zm0 0" fill="#ffce54"/><g fill="#f5f7fa"><path d="m184.238281 228.5c-2.207031 0-4.039062-1.792969-4.039062-4s1.753906-4 3.960937-4h.085938c2.203125 0 4 1.792969 4 4s-1.796875 4-4.007813 4zm0 0"/><path d="m184 244.507812h-72c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0"/><path d="m184 212.5h-56c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h56c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m168 228.5h-88c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h88c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m184 196.5h-16c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h16c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm-32 0h-96c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h96c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m112 212.5h-8c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h8c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/></g><path d="m383.984375 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m359.984375 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m379.984375 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m359.984375 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m440.015625 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m416.015625 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m436.015625 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m416.015625 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m239.984375 124.5h-151.96875c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h151.96875c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#545c66"/><path d="m256 300.5h-184c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h184c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m200 316.5h-72c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m308 40.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/><path d="m324 24.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/></svg>
|
||||||
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg height="504pt" viewBox="0 -71 504 503" width="504pt" xmlns="http://www.w3.org/2000/svg"><path d="m388 56.5h-60v304h120v-304zm0 0" fill="#656d78"/><path d="m304 80.5h-280v256h280zm24-24v304h-328v-304zm0 0" fill="#ffd2a6"/><path d="m300 80.5c2.199219 0 4 1.800781 4 4v248c0 2.199219-1.800781 4-4 4h-272c-2.199219 0-4-1.800781-4-4v-248c0-2.199219 1.800781-4 4-4zm0 0" fill="#ed5565"/><path d="m56 .5h328l-56 56h-328zm0 0" fill="#f2c397"/><path d="m448 56.5h-24l56-56h24zm0 0" fill="#ccd1d9"/><path d="m480 .5-56 56h-96l56-56zm0 0" fill="#ccd1d9"/><path d="m504 .5v304l-56 56v-304zm0 0" fill="#e6e9ed"/><path d="m276 104.5c2.199219 0 4 1.800781 4 4v24c0 2.199219-1.800781 4-4 4h-224c-2.199219 0-4-1.800781-4-4v-24c0-2.199219 1.800781-4 4-4zm0 0" fill="#656d78"/><path d="m267.328125 214.292969c-.703125-1.058594-17.761719-25.785157-67.328125-25.792969-1.0625 0-2.078125.425781-2.832031 1.167969-.753907.742187-1.167969 1.769531-1.167969 2.832031v48.015625c0 2.207031 1.792969 4 4 4 49.566406 0 66.625-24.734375 67.328125-25.792969.894531-1.34375.894531-3.085937 0-4.429687zm0 0" fill="#ffce54"/><g fill="#f5f7fa"><path d="m184.238281 228.5c-2.207031 0-4.039062-1.792969-4.039062-4s1.753906-4 3.960937-4h.085938c2.203125 0 4 1.792969 4 4s-1.796875 4-4.007813 4zm0 0"/><path d="m184 244.507812h-72c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0"/><path d="m184 212.5h-56c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h56c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m168 228.5h-88c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h88c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m184 196.5h-16c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h16c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm-32 0h-96c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h96c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/><path d="m112 212.5h-8c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h8c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0"/></g><path d="m383.984375 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m359.984375 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m379.984375 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m359.984375 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m440.015625 184.523438v131.953124c-4.398437 0-8 3.597657-8 8v8h-32v-8c0-4.402343-3.601563-8-8-8v-131.953124l8-16v-16h32v16zm0 0" fill="#f6bb42"/><path d="m416.015625 80.523438s-16 32-16 64v8h32v-8c0-32-16-64-16-64zm0 0" fill="#fc6e51"/><path d="m436.015625 336.476562h-40.007813c-2.207031 0-4-1.792968-4-4 0-2.207031 1.792969-4 4-4h40.007813c2.207031 0 4 1.792969 4 4 0 2.207032-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m416.015625 304.46875c-2.207031 0-4-1.792969-4-4v-106.578125c0-2.207031 1.792969-4 4-4s4 1.792969 4 4v106.578125c0 2.207031-1.792969 4-4 4zm0 0" fill="#ffce54"/><path d="m239.984375 124.5h-151.96875c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h151.96875c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#545c66"/><path d="m256 300.5h-184c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h184c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m200 316.5h-72c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h72c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#da4453"/><path d="m308 40.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/><path d="m324 24.5h-248c-2.207031 0-4-1.792969-4-4s1.792969-4 4-4h248c2.207031 0 4 1.792969 4 4s-1.792969 4-4 4zm0 0" fill="#ffd2a6"/></svg>
|
||||||
|
After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" width="512" height="512">
|
||||||
|
<g>
|
||||||
|
<rect x="154.93" y="24.724" style="fill:#2D3B42;" width="202.141" height="127.742"/>
|
||||||
|
<path style="fill:#546E7A;" d="M428.232,175.136v319.093c0,9.814-7.965,17.771-17.79,17.771H101.558 c-9.825,0-17.79-7.956-17.79-17.771V175.136c0-16.08,5.048-31.754,14.433-44.811l0.011-0.015 c9.385-13.057,14.433-28.731,14.433-44.811V4c0-2.209,1.791-4,4-4h53.88c2.209,0,4,1.791,4,4v65.932 c0,22.256,18.062,40.298,40.343,40.298h82.265c22.281,0,40.343-18.042,40.343-40.298V4c0-2.209,1.791-4,4-4h53.88 c2.209,0,4,1.791,4,4v81.5c0,16.08,5.048,31.754,14.433,44.811l0.011,0.015C423.184,143.383,428.232,159.056,428.232,175.136z"/>
|
||||||
|
<g>
|
||||||
|
<path style="fill:#455A64;" d="M183.928,110.229h30.94c-22.281,0-40.343-18.042-40.343-40.298V4c0-2.209-1.791-4-4-4h-26.94 v69.932C143.585,92.187,161.647,110.229,183.928,110.229z"/>
|
||||||
|
<path style="fill:#455A64;" d="M413.794,130.318L413.794,130.318c-9.389-13.063-14.439-28.738-14.439-44.818V4 c0-2.209-1.791-4-4-4h-26.94v85.5c0,16.08,5.05,31.756,14.439,44.818l0,0c9.389,13.063,14.439,28.738,14.439,44.818v319.093 c0,9.814-7.965,17.771-17.79,17.771h30.94c9.825,0,17.79-7.956,17.79-17.771V175.136 C428.232,159.056,423.182,143.38,413.794,130.318z"/>
|
||||||
|
</g>
|
||||||
|
<path style="fill:#37474F;" d="M364.823,167.92H148.209c-8.534,0-15.453-6.918-15.453-15.453v0c0-8.534,6.918-15.453,15.453-15.453 h216.614c8.534,0,15.453,6.918,15.453,15.453v0C380.275,161.001,373.357,167.92,364.823,167.92z"/>
|
||||||
|
<path style="fill:#37474F;" d="M364.823,227.67H148.209c-8.534,0-15.453-6.918-15.453-15.453v0c0-8.534,6.918-15.453,15.453-15.453 h216.614c8.534,0,15.453,6.918,15.453,15.453v0C380.275,220.752,373.357,227.67,364.823,227.67z"/>
|
||||||
|
<path style="fill:#37474F;" d="M364.823,287.421H148.209c-8.534,0-15.453-6.918-15.453-15.453v0 c0-8.534,6.918-15.453,15.453-15.453h216.614c8.534,0,15.453,6.918,15.453,15.453v0 C380.275,280.502,373.357,287.421,364.823,287.421z"/>
|
||||||
|
<g>
|
||||||
|
<path style="fill:#455A64;" d="M184.328,474.913H68.808c-5.693,0-10.308-4.615-10.308-10.308V319.362 c0-5.693,4.615-10.308,10.308-10.308h45.825c44.184,0,80.003,35.819,80.003,80.003v75.549 C194.636,470.299,190.021,474.913,184.328,474.913z"/>
|
||||||
|
<path style="fill:#37474F;" d="M114.588,309.054h-30.94c44.209,0,80.048,35.799,80.048,79.958v75.599 c0,5.69-4.617,10.302-10.313,10.302h30.94c5.696,0,10.313-4.612,10.313-10.302v-75.599 C194.636,344.853,158.797,309.054,114.588,309.054z"/>
|
||||||
|
<path style="fill:#455A64;" d="M327.672,474.913h115.521c5.693,0,10.308-4.615,10.308-10.308V319.362 c0-5.693-4.615-10.308-10.308-10.308h-45.825c-44.184,0-80.003,35.819-80.003,80.003v75.549 C317.364,470.299,321.979,474.913,327.672,474.913z"/>
|
||||||
|
<path style="fill:#37474F;" d="M443.187,309.054h-30.94c5.696,0,10.313,4.612,10.313,10.302v145.256 c0,5.69-4.617,10.302-10.313,10.302h30.94c5.696,0,10.313-4.612,10.313-10.302V319.356 C453.5,313.667,448.883,309.054,443.187,309.054z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -14,7 +14,7 @@
|
|||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<ul>
|
<ul>
|
||||||
<li name="side1" class="sidebaritem1" onclick="switchSite('backpackClass')"><img class="sideicon1" src="img/backpack/backpack.svg"><p class="bartext">Rucksack</p></li>
|
<li name="side1" class="sidebaritem1" onclick="switchSite('backpackClass')"><img class="sideicon1" src="img/backpack/backpack.svg"><p class="bartext">Rucksack</p></li>
|
||||||
<li name="side2" class="sidebaritem2" onclick="switchSite('vehClass')"><img class="sideicon2" src="img/backpack/car.svg"><p class="bartext">Fahrzeug</p></li>
|
<li name="side2" class="sidebaritem2" onclick="getVehicle()"><img class="sideicon2" src="img/backpack/car.svg"><p class="bartext">Fahrzeug</p></li>
|
||||||
<li name="side3" class="sidebaritem3" onclick="switchSite('tradeClass')"><img class="sideicon4" src="img/backpack/trading.svg"><p class="bartext">Handel</p></li>
|
<li name="side3" class="sidebaritem3" onclick="switchSite('tradeClass')"><img class="sideicon4" src="img/backpack/trading.svg"><p class="bartext">Handel</p></li>
|
||||||
<li name="side4" class="sidebaritem4 hidden" onclick="switchSite('handelClass')"><img class="sideicon4" src="img/backpack/trading.svg"><p class="bartext">Handeln</p></li>
|
<li name="side4" class="sidebaritem4 hidden" onclick="switchSite('handelClass')"><img class="sideicon4" src="img/backpack/trading.svg"><p class="bartext">Handeln</p></li>
|
||||||
<li name="side5" class="sidebaritem5 hidden" onclick="getTrade()"><img class="sideicon4" src="img/backpack/save-money.svg"><p class="bartext">Anfrage</p></li>
|
<li name="side5" class="sidebaritem5 hidden" onclick="getTrade()"><img class="sideicon4" src="img/backpack/save-money.svg"><p class="bartext">Anfrage</p></li>
|
||||||
@@ -109,6 +109,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getVehicle() {
|
||||||
|
if (vehInv.length > 0) {
|
||||||
|
switchSite('vehClass');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$("#tf_acceptTrade").unbind('click').click(function () {
|
$("#tf_acceptTrade").unbind('click').click(function () {
|
||||||
if (anfrageInv.length > 0) {
|
if (anfrageInv.length > 0) {
|
||||||
mp.trigger("CEF:acceptTrade");
|
mp.trigger("CEF:acceptTrade");
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
var errorShown = false;
|
var errorShown = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(_ => {
|
$(document).ready(_ => {
|
||||||
mp.trigger("CEF:Login_RequestPlayerName");
|
mp.trigger("CEF:Login_RequestPlayerName");
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ export default function checkpointHandle(globalData: GlobalData) {
|
|||||||
delayCounter = 0;
|
delayCounter = 0;
|
||||||
checkPointsDone = checkPointID;
|
checkPointsDone = checkPointID;
|
||||||
event = nEvent;
|
event = nEvent;
|
||||||
activeCheckpoint = mp.markers.new(markerID, posCp, 3.0, {
|
let vectorCP = new mp.Vector3(posCp.x, posCp.y, posCp.z - 2)
|
||||||
|
activeCheckpoint = mp.markers.new(markerID, vectorCP, 4.0, {
|
||||||
color: [255, 0, 0, 150],
|
color: [255, 0, 0, 150],
|
||||||
visible: true,
|
visible: true,
|
||||||
dimension: 0
|
dimension: 0
|
||||||
@@ -42,14 +43,14 @@ export default function checkpointHandle(globalData: GlobalData) {
|
|||||||
|
|
||||||
if (!inCheckpoint) {
|
if (!inCheckpoint) {
|
||||||
if (delay != 0) {
|
if (delay != 0) {
|
||||||
mp.gui.chat.push("Warte nun " + delay / 1000 + " Sekunden");
|
mp.gui.chat.push("Warte nun " + delay / 1000 + " Sekunden.");
|
||||||
}
|
}
|
||||||
mp.game.audio.playSoundFrontend(1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", true);
|
mp.game.audio.playSoundFrontend(1, "Beep_Red", "DLC_HEIST_HACKING_SNAKE_SOUNDS", true);
|
||||||
}
|
}
|
||||||
inCheckpoint = true;
|
inCheckpoint = true;
|
||||||
|
|
||||||
if (delayCounter >= delay) {
|
if (delayCounter >= delay) {
|
||||||
activeCheckpoint.visible = false;
|
activeCheckpoint.destroy();
|
||||||
clearInterval(myVar);
|
clearInterval(myVar);
|
||||||
mp.events.callRemote("playerInCheckpoint");
|
mp.events.callRemote("playerInCheckpoint");
|
||||||
if (event != "") {
|
if (event != "") {
|
||||||
@@ -66,4 +67,9 @@ export default function checkpointHandle(globalData: GlobalData) {
|
|||||||
delayCounter = 0;
|
delayCounter = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mp.events.add('destroyCP', () => {
|
||||||
|
activeCheckpoint.destroy();
|
||||||
|
clearInterval(myVar);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ namespace ReallifeGamemode.Database.Entities
|
|||||||
[StringLength(32)]
|
[StringLength(32)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public bool StateOwned { get; set; }
|
public bool StateOwned { get; set; }
|
||||||
|
public int WeaponDealTime { get; set; } = 60;
|
||||||
|
|
||||||
public IBankAccount GetBankAccount(DatabaseContext databaseContext = null)
|
public IBankAccount GetBankAccount(DatabaseContext databaseContext = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ namespace ReallifeGamemode.Database.Entities
|
|||||||
|
|
||||||
public int JailTime { get; set; }
|
public int JailTime { get; set; }
|
||||||
|
|
||||||
public int PaydayTimer { get; set; }
|
public int PaydayTimer { get; set; } = 60;
|
||||||
|
|
||||||
public bool IsAdmin(AdminLevel level) => AdminLevel >= level;
|
public bool IsAdmin(AdminLevel level) => AdminLevel >= level;
|
||||||
|
|
||||||
|
|||||||
1312
ReallifeGamemode.Database/Migrations/20190922163450_WeaponDealTimer.Designer.cs
generated
Normal file
1312
ReallifeGamemode.Database/Migrations/20190922163450_WeaponDealTimer.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,35 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class WeaponDealTimer : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "WeaponDealTime",
|
||||||
|
table: "Factions",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "PaydayTimer",
|
||||||
|
table: "Users",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "WeaponDealTime",
|
||||||
|
table: "Factions");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "PaydayTimer",
|
||||||
|
table: "Users",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -356,6 +356,8 @@ namespace ReallifeGamemode.Database.Migrations
|
|||||||
|
|
||||||
b.Property<bool>("StateOwned");
|
b.Property<bool>("StateOwned");
|
||||||
|
|
||||||
|
b.Property<int>("WeaponDealTime");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("Factions");
|
b.ToTable("Factions");
|
||||||
|
|||||||
35
ReallifeGamemode.Server/Events/EnterVehicle.cs
Normal file
35
ReallifeGamemode.Server/Events/EnterVehicle.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using GTANetworkAPI;
|
||||||
|
using ReallifeGamemode.Database.Entities;
|
||||||
|
using ReallifeGamemode.Server.Extensions;
|
||||||
|
using ReallifeGamemode.Server.Util;
|
||||||
|
using ReallifeGamemode.Server.WeaponDeal;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Events
|
||||||
|
{
|
||||||
|
public class EnterVehicle : Script
|
||||||
|
{
|
||||||
|
[ServerEvent(Event.PlayerEnterVehicle)]
|
||||||
|
public void OnPlayerEnterVehicle(Client client, Vehicle vehicle, sbyte seat)
|
||||||
|
{
|
||||||
|
if (seat != -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Console.WriteLine("inVEhicle");
|
||||||
|
if (vehicle.GetServerVehicle() is FactionVehicle veh)
|
||||||
|
{
|
||||||
|
if (client.GetUser().FactionId != null && (veh.FactionId == client.GetUser().FactionId) && (veh.Model == VehicleHash.Burrito3) && vehicle.HasData("weaponDeal") && vehicle.GetData("weaponDeal") == true)
|
||||||
|
{
|
||||||
|
Vector3 vector = WeaponDealPoints.getRndWD_Route(client.GetUser().FactionId.Value);
|
||||||
|
if (vector == null)
|
||||||
|
return;
|
||||||
|
List<Vector3> dealPoint = new List<Vector3>();
|
||||||
|
dealPoint.Add(vector);
|
||||||
|
CheckPointHandle.StartCheckPointRoute(client, dealPoint, 5000, 1, "loadWeaponTransport");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ using System.Text;
|
|||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
using ReallifeGamemode.Database.Entities;
|
using ReallifeGamemode.Database.Entities;
|
||||||
using ReallifeGamemode.Server.Extensions;
|
using ReallifeGamemode.Server.Extensions;
|
||||||
|
using ReallifeGamemode.Server.WeaponDeal;
|
||||||
|
|
||||||
namespace ReallifeGamemode.Server.Events
|
namespace ReallifeGamemode.Server.Events
|
||||||
{
|
{
|
||||||
@@ -25,6 +26,11 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
{
|
{
|
||||||
if (veh.FactionId != player.GetUser().FactionId)
|
if (veh.FactionId != player.GetUser().FactionId)
|
||||||
{
|
{
|
||||||
|
if ((VehicleHash)vehicle.Model == VehicleHash.Burrito3)
|
||||||
|
{
|
||||||
|
if (WeaponDealManager.checkWeaponDbyVehicle(vehicle))
|
||||||
|
return;
|
||||||
|
}
|
||||||
player.StopAnimation();
|
player.StopAnimation();
|
||||||
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht benutzen!", true);
|
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht benutzen!", true);
|
||||||
return;
|
return;
|
||||||
|
|||||||
30
ReallifeGamemode.Server/Events/ExitVehicle.cs
Normal file
30
ReallifeGamemode.Server/Events/ExitVehicle.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using GTANetworkAPI;
|
||||||
|
using ReallifeGamemode.Database.Entities;
|
||||||
|
using ReallifeGamemode.Server.Extensions;
|
||||||
|
using ReallifeGamemode.Server.Util;
|
||||||
|
using ReallifeGamemode.Server.WeaponDeal;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Events
|
||||||
|
{
|
||||||
|
public class ExitVehicle:Script
|
||||||
|
{
|
||||||
|
[ServerEvent(Event.PlayerExitVehicleAttempt)]
|
||||||
|
public void OnPlayerExitVehicle(Client client, Vehicle vehicle)
|
||||||
|
{
|
||||||
|
if (client.VehicleSeat != -1)
|
||||||
|
return;
|
||||||
|
if (vehicle.GetServerVehicle() is FactionVehicle veh)
|
||||||
|
{
|
||||||
|
if ((client.GetUser().FactionId != null) && (veh.FactionId == client.GetUser().FactionId) && ((VehicleHash)vehicle.Model == VehicleHash.Burrito3) && vehicle.HasData("weaponDeal") && vehicle.GetData("weaponDeal") == true)
|
||||||
|
{
|
||||||
|
CheckPointHandle.RemovePlayerHandlerFromList(client);
|
||||||
|
client.TriggerEvent("destroyCP");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ using ReallifeGamemode.Server.Extensions;
|
|||||||
using ReallifeGamemode.Server.Inventory.Interfaces;
|
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||||
using ReallifeGamemode.Server.Managers;
|
using ReallifeGamemode.Server.Managers;
|
||||||
using ReallifeGamemode.Server.Util;
|
using ReallifeGamemode.Server.Util;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace ReallifeGamemode.Server.Events
|
namespace ReallifeGamemode.Server.Events
|
||||||
{
|
{
|
||||||
@@ -18,22 +19,35 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
public void SrvEvent_GetNearVehicles(Client client)
|
public void SrvEvent_GetNearVehicles(Client client)
|
||||||
{
|
{
|
||||||
var user = client.GetUser();
|
var user = client.GetUser();
|
||||||
var inventoryWeight = 0;
|
|
||||||
List<VehicleInventory> vehicleInventory = new List<VehicleInventory>();
|
|
||||||
if (!client.IsInVehicle)
|
if (!client.IsInVehicle)
|
||||||
{
|
{
|
||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
foreach (GTANetworkAPI.Vehicle veh in NAPI.Pools.GetAllVehicles())
|
foreach (GTANetworkAPI.Vehicle veh in NAPI.Pools.GetAllVehicles())
|
||||||
|
{
|
||||||
|
List<VehicleInventory> vehicleInventory = new List<VehicleInventory>();
|
||||||
|
if (veh.Position.DistanceTo(client.Position) < 5f)
|
||||||
|
{
|
||||||
|
if (VehicleStreaming.GetDoorState(veh, DoorID.DoorTrunk) == DoorState.DoorOpen || VehicleStreaming.GetDoorState(veh, DoorID.DoorRearLeft) == DoorState.DoorOpen || VehicleStreaming.GetDoorState(veh, DoorID.DoorRearRight) == DoorState.DoorOpen)
|
||||||
|
{
|
||||||
|
vehicleInventory = getVehItem(veh);
|
||||||
|
}
|
||||||
|
client.TriggerEvent("setVehiclesInventory", vehicleInventory.ToArray());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<VehicleInventory> getVehItem(Vehicle veh)
|
||||||
{
|
{
|
||||||
List<string> iName = new List<string>();
|
List<string> iName = new List<string>();
|
||||||
List<int> iAmount = new List<int>();
|
List<int> iAmount = new List<int>();
|
||||||
List<int> iId = new List<int>();
|
List<int> iId = new List<int>();
|
||||||
inventoryWeight = 0;
|
List<VehicleInventory> vehicleInventory = new List<VehicleInventory>();
|
||||||
|
var inventoryWeight = 0;
|
||||||
if (veh.Position.DistanceTo(client.Position) < 2.5f)
|
using (var context = new DatabaseContext())
|
||||||
{
|
|
||||||
if (VehicleStreaming.GetDoorState(veh, DoorID.DoorTrunk) == DoorState.DoorOpen)
|
|
||||||
{
|
{
|
||||||
ServerVehicle serverVehicle = VehicleManager.GetServerVehicleFromVehicle(veh, context);
|
ServerVehicle serverVehicle = VehicleManager.GetServerVehicleFromVehicle(veh, context);
|
||||||
List<VehicleItem> vehicleItems = context.VehicleItems.ToList().FindAll(i => i.VehicleId == serverVehicle.Id);
|
List<VehicleItem> vehicleItems = context.VehicleItems.ToList().FindAll(i => i.VehicleId == serverVehicle.Id);
|
||||||
@@ -59,12 +73,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
};
|
};
|
||||||
vehicleInventory.Add(vehInv);
|
vehicleInventory.Add(vehInv);
|
||||||
}
|
}
|
||||||
client.TriggerEvent("setVehiclesInventory", vehicleInventory.ToArray());
|
return vehicleInventory;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,6 +229,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
List<string> secondarys = new List<string>();
|
List<string> secondarys = new List<string>();
|
||||||
List<string> melees = new List<string>();
|
List<string> melees = new List<string>();
|
||||||
List<string> specials = new List<string>();
|
List<string> specials = new List<string>();
|
||||||
|
List<string> timer = new List<string>();
|
||||||
|
string dealTime = "Starten";
|
||||||
primarys.Add("Keine");
|
primarys.Add("Keine");
|
||||||
secondarys.Add("Keine");
|
secondarys.Add("Keine");
|
||||||
melees.Add("Keine");
|
melees.Add("Keine");
|
||||||
@@ -236,10 +238,16 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
List<FactionWeapon> weapons = context.FactionWeapons.Where(w => w.FactionId == user.FactionId).ToList();
|
List<FactionWeapon> weapons = context.FactionWeapons.Where(w => w.FactionId == user.FactionId).ToList();
|
||||||
|
Database.Entities.Faction faction = context.Factions.Where(fac => fac.Id == user.FactionId).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
|
if (faction.WeaponDealTime > 0)
|
||||||
|
dealTime = "noch " + faction.WeaponDealTime.ToString()+" min. übrig";
|
||||||
|
|
||||||
|
timer.Add(dealTime);
|
||||||
|
|
||||||
foreach (var weapon in weapons)
|
foreach (var weapon in weapons)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
switch (weapon.SlotID)
|
switch (weapon.SlotID)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@@ -262,7 +270,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray());
|
player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray(), JsonConvert.SerializeObject(timer.ToArray()));
|
||||||
}
|
}
|
||||||
if (nearestJailReleasePoint != null)
|
if (nearestJailReleasePoint != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using GTANetworkAPI;
|
||||||
|
using ReallifeGamemode.Database.Entities;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Inventory.Interfaces
|
||||||
|
{
|
||||||
|
public interface IWeaponDealItem : IItem, IDroppableItem
|
||||||
|
{
|
||||||
|
bool noTransfer(Client client, UserItem uItem, FactionVehicle fVeh);
|
||||||
|
}
|
||||||
|
}
|
||||||
23
ReallifeGamemode.Server/Inventory/Items/CarbineRifle.cs
Normal file
23
ReallifeGamemode.Server/Inventory/Items/CarbineRifle.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
|
||||||
|
* @author VegaZ
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Inventory.Items
|
||||||
|
{
|
||||||
|
public class CarbineRifle : WeaponDealItem
|
||||||
|
{
|
||||||
|
public override int Id => 13;
|
||||||
|
public override string Name => "CarbineRifle";
|
||||||
|
public override string Description => "Waffe";
|
||||||
|
public override int Gewicht => 4000;
|
||||||
|
public override string Einheit => "g";
|
||||||
|
public override uint Object => 3666746839; //3061944032
|
||||||
|
}
|
||||||
|
}
|
||||||
23
ReallifeGamemode.Server/Inventory/Items/Pistol05.cs
Normal file
23
ReallifeGamemode.Server/Inventory/Items/Pistol05.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
|
||||||
|
* @author VegaZ
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Inventory.Items
|
||||||
|
{
|
||||||
|
public class Pistol05 : WeaponDealItem
|
||||||
|
{
|
||||||
|
public override int Id => 11;
|
||||||
|
public override string Name => "Pistol05";
|
||||||
|
public override string Description => "Waffe";
|
||||||
|
public override int Gewicht => 1180;
|
||||||
|
public override string Einheit => "g";
|
||||||
|
public override uint Object => 3666746839; //3061944032
|
||||||
|
}
|
||||||
|
}
|
||||||
23
ReallifeGamemode.Server/Inventory/Items/PumpShotgun.cs
Normal file
23
ReallifeGamemode.Server/Inventory/Items/PumpShotgun.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
|
||||||
|
* @author VegaZ
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Inventory.Items
|
||||||
|
{
|
||||||
|
public class PumpShotgun : WeaponDealItem
|
||||||
|
{
|
||||||
|
public override int Id => 14;
|
||||||
|
public override string Name => "PumpShotgun";
|
||||||
|
public override string Description => "Waffe";
|
||||||
|
public override int Gewicht => 3600;
|
||||||
|
public override string Einheit => "g";
|
||||||
|
public override uint Object => 3666746839; //3061944032
|
||||||
|
}
|
||||||
|
}
|
||||||
23
ReallifeGamemode.Server/Inventory/Items/SMG.cs
Normal file
23
ReallifeGamemode.Server/Inventory/Items/SMG.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
|
||||||
|
* @author VegaZ
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Inventory.Items
|
||||||
|
{
|
||||||
|
public class SMG : WeaponDealItem
|
||||||
|
{
|
||||||
|
public override int Id => 12;
|
||||||
|
public override string Name => "SMG";
|
||||||
|
public override string Description => "Waffe";
|
||||||
|
public override int Gewicht => 3080;
|
||||||
|
public override string Einheit => "g";
|
||||||
|
public override uint Object => 3666746839; //3061944032
|
||||||
|
}
|
||||||
|
}
|
||||||
23
ReallifeGamemode.Server/Inventory/Items/Schutzweste.cs
Normal file
23
ReallifeGamemode.Server/Inventory/Items/Schutzweste.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
|
||||||
|
* @author VegaZ
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Inventory.Items
|
||||||
|
{
|
||||||
|
public class Schutzweste : WeaponDealItem
|
||||||
|
{
|
||||||
|
public override int Id => 16;
|
||||||
|
public override string Name => "Schutzweste";
|
||||||
|
public override string Description => "Waffe";
|
||||||
|
public override int Gewicht => 3000;
|
||||||
|
public override string Einheit => "g";
|
||||||
|
public override uint Object => 3666746839; //3061944032
|
||||||
|
}
|
||||||
|
}
|
||||||
23
ReallifeGamemode.Server/Inventory/Items/SniperRifle.cs
Normal file
23
ReallifeGamemode.Server/Inventory/Items/SniperRifle.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
|
||||||
|
* @author VegaZ
|
||||||
|
* @copyright (c) 2008 - 2018 Life of German
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Inventory.Items
|
||||||
|
{
|
||||||
|
public class SniperRifle : WeaponDealItem
|
||||||
|
{
|
||||||
|
public override int Id => 15;
|
||||||
|
public override string Name => "SniperRifle";
|
||||||
|
public override string Description => "Waffe";
|
||||||
|
public override int Gewicht => 12900;
|
||||||
|
public override string Einheit => "g";
|
||||||
|
public override uint Object => 3666746839; //3061944032
|
||||||
|
}
|
||||||
|
}
|
||||||
31
ReallifeGamemode.Server/Inventory/Items/WeaponDealItem.cs
Normal file
31
ReallifeGamemode.Server/Inventory/Items/WeaponDealItem.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using GTANetworkAPI;
|
||||||
|
using ReallifeGamemode.Database.Entities;
|
||||||
|
using ReallifeGamemode.Server.Extensions;
|
||||||
|
using ReallifeGamemode.Server.Inventory.Interfaces;
|
||||||
|
using ReallifeGamemode.Server.Managers;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.Inventory.Items
|
||||||
|
{
|
||||||
|
public abstract class WeaponDealItem : IWeaponDealItem
|
||||||
|
{
|
||||||
|
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 bool noTransfer(Client client, UserItem uItem, FactionVehicle fVeh)
|
||||||
|
{
|
||||||
|
if (fVeh.FactionId != client.GetUser().FactionId)
|
||||||
|
return false;
|
||||||
|
if (fVeh.Model != VehicleHash.Burrito3)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -190,7 +190,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
foreach (Vehicle veh in NAPI.Pools.GetAllVehicles())
|
foreach (Vehicle veh in NAPI.Pools.GetAllVehicles())
|
||||||
{
|
{
|
||||||
if (veh.Position.DistanceTo(client.Position) < 2.5f)
|
if (veh.Position.DistanceTo(client.Position) < 5f)
|
||||||
{
|
{
|
||||||
if (VehicleStreaming.GetDoorState(veh, DoorID.DoorTrunk) == DoorState.DoorOpen)
|
if (VehicleStreaming.GetDoorState(veh, DoorID.DoorTrunk) == DoorState.DoorOpen)
|
||||||
{
|
{
|
||||||
@@ -253,6 +253,13 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
};
|
};
|
||||||
|
|
||||||
UserItem uItem = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == cItem.ItemId).FirstOrDefault();
|
UserItem uItem = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == cItem.ItemId).FirstOrDefault();
|
||||||
|
IItem iItem = GetItemById(cItem.ItemId);
|
||||||
|
|
||||||
|
if(iItem is IWeaponDealItem weaponDealItem)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (uItem != null)
|
if (uItem != null)
|
||||||
{
|
{
|
||||||
if (vehAmount < uItem.Amount)
|
if (vehAmount < uItem.Amount)
|
||||||
@@ -407,6 +414,53 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void AddItemToVehicleInventory(Client player, VehicleItem item, Vehicle veh)
|
||||||
|
{
|
||||||
|
var user = player.GetUser();
|
||||||
|
using (var context = new DatabaseContext())
|
||||||
|
{
|
||||||
|
ServerVehicle sVeh = VehicleManager.GetServerVehicleFromVehicle(veh);
|
||||||
|
VehicleItem existingItem = context.VehicleItems.FirstOrDefault(i => i.ItemId == item.ItemId && i.VehicleId == sVeh.Id);
|
||||||
|
if (existingItem != null)
|
||||||
|
{
|
||||||
|
existingItem.Amount += item.Amount;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<VehicleItem> allItemsByVehicle = context.VehicleItems.ToList().FindAll(i => i.VehicleId == sVeh.Id);
|
||||||
|
var slotArr = Enumerable.Range(1, 20).ToList();
|
||||||
|
allItemsByVehicle.ForEach(allItem =>
|
||||||
|
{
|
||||||
|
if (slotArr.Contains(allItem.Slot)) slotArr.Remove(allItem.Slot);
|
||||||
|
});
|
||||||
|
|
||||||
|
int newSlot = slotArr.Min();
|
||||||
|
|
||||||
|
item.Slot = newSlot;
|
||||||
|
context.VehicleItems.Add(item);
|
||||||
|
|
||||||
|
IItem iItem = GetItemById(item.ItemId);
|
||||||
|
|
||||||
|
string[] newItem = new string[] { iItem.Name, iItem.Description, iItem.Gewicht.ToString(), item.Amount.ToString(), newSlot.ToString(), item.Id.ToString() };
|
||||||
|
}
|
||||||
|
context.SaveChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RemoveAllItemsfromVehicleInventory(Vehicle veh)
|
||||||
|
{
|
||||||
|
using(var context = new DatabaseContext())
|
||||||
|
{
|
||||||
|
ServerVehicle sVeh = VehicleManager.GetServerVehicleFromVehicle(veh);
|
||||||
|
List<VehicleItem> allItemsByVehicle = context.VehicleItems.ToList().FindAll(i => i.VehicleId == sVeh.Id);
|
||||||
|
allItemsByVehicle.ForEach(allItem =>
|
||||||
|
{
|
||||||
|
context.Remove(allItem);
|
||||||
|
});
|
||||||
|
context.SaveChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[RemoteEvent("removeItemAsAdmin")]
|
[RemoteEvent("removeItemAsAdmin")]
|
||||||
public void RemoveAsAdminInventory(Client player, string amount, string userItemId, string targetPlayerName)
|
public void RemoveAsAdminInventory(Client player, string amount, string userItemId, string targetPlayerName)
|
||||||
{
|
{
|
||||||
@@ -486,10 +540,19 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
if (iItem is IDroppableItem usableItemObj2)
|
if (iItem is IDroppableItem usableItemObj2)
|
||||||
{
|
{
|
||||||
Vector3 dropPosition = ClientExtension.GetPositionFromPlayer(player, 0.6f, 0);
|
Vector3 dropPosition = ClientExtension.GetPositionFromPlayer(player, 0.6f, 0);
|
||||||
dropPosition.Z -= 0.8f;
|
|
||||||
//new Vector3(player.Position.X, player.Position.Y, player.Position.Z - 0.8f);
|
//new Vector3(player.Position.X, player.Position.Y, player.Position.Z - 0.8f);
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
GTANetworkAPI.Object grndObject = NAPI.Object.CreateObject(3777723516, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 0);
|
GTANetworkAPI.Object grndObject;
|
||||||
|
if (iItem is IWeaponDealItem obj)
|
||||||
|
{
|
||||||
|
dropPosition.Z -= 1.05f;
|
||||||
|
grndObject = NAPI.Object.CreateObject(3666746839, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dropPosition.Z -= 0.8f;
|
||||||
|
grndObject = NAPI.Object.CreateObject(3777723516, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 0);
|
||||||
|
}
|
||||||
GroundItem grndItem = new GroundItem { ItemId = iItem.Id, Amount = amount, Position = dropPosition };
|
GroundItem grndItem = new GroundItem { ItemId = iItem.Id, Amount = amount, Position = dropPosition };
|
||||||
TextLabel grndTxtLbl = NAPI.TextLabel.CreateTextLabel(iItem.Name + " ~s~(~y~" + amount + "~s~)", dropPosition, 5, 0.5f, 4, new Color(255, 255, 255), false, 0);
|
TextLabel grndTxtLbl = NAPI.TextLabel.CreateTextLabel(iItem.Name + " ~s~(~y~" + amount + "~s~)", dropPosition, 5, 0.5f, 4, new Color(255, 255, 255), false, 0);
|
||||||
GroundItem.AddGroundItem(grndItem, grndObject, grndTxtLbl);
|
GroundItem.AddGroundItem(grndItem, grndObject, grndTxtLbl);
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ namespace ReallifeGamemode.Server.Util
|
|||||||
}
|
}
|
||||||
if (this.list.Count() == checkPointsDone)
|
if (this.list.Count() == checkPointsDone)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(this.player, "Du hast alle Checkpoints abgefahren!");
|
|
||||||
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
|
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
86
ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs
Normal file
86
ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using GTANetworkAPI;
|
||||||
|
using ReallifeGamemode.Database.Entities;
|
||||||
|
using ReallifeGamemode.Database.Models;
|
||||||
|
using ReallifeGamemode.Server.Extensions;
|
||||||
|
using ReallifeGamemode.Server.Managers;
|
||||||
|
using System.Linq;
|
||||||
|
using ReallifeGamemode.Server.Services;
|
||||||
|
using ReallifeGamemode.Server.Util;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.WeaponDeal
|
||||||
|
{
|
||||||
|
public class WeaponDealManager:Script
|
||||||
|
{
|
||||||
|
public static bool checkWeaponDbyVehicle(Vehicle vehicle)
|
||||||
|
{
|
||||||
|
if (!vehicle.HasData("WeaponDealLoad") || vehicle.GetData("WeaponDealLoad") == false)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
[RemoteEvent("startWeaponDeal")]
|
||||||
|
public void SrvEVENT_startWeaponDeal(Client client)
|
||||||
|
{
|
||||||
|
var user = client.GetUser();
|
||||||
|
using (var context = new DatabaseContext())
|
||||||
|
{
|
||||||
|
FactionVehicle factionVehicle = context.FactionVehicles.Where(f => f.FactionId == user.FactionId && f.Model == VehicleHash.Burrito3).FirstOrDefault();
|
||||||
|
Vehicle fVeh = VehicleManager.GetVehicleFromServerVehicle(factionVehicle);
|
||||||
|
|
||||||
|
if (fVeh.Position.DistanceTo(client.Position) > 50)
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(client, "Der Transporter ist zu weit entfernt");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (user.Faction.WeaponDealTime <= 0)
|
||||||
|
{
|
||||||
|
ChatService.BroadcastFaction("Die albanische Mafia hat einen Deal mit deiner Fraktion abgemacht!", user.Faction);
|
||||||
|
ChatService.SendMessage(client, "Steige in den Burrito ein und fahre zum Waffendeal.");
|
||||||
|
fVeh.SetData("weaponDeal", true);
|
||||||
|
WeaponDealPoints.factionWeaponDeal[user.FactionId.Value] = -1;
|
||||||
|
user.Faction.WeaponDealTime = 60;
|
||||||
|
context.SaveChanges();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ChatService.ErrorMessage(client, "Du kannst noch kein Waffendeal starten");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[RemoteEvent("loadWeaponTransport")]
|
||||||
|
public void SrvEVENT_loadWeaponTransport(Client client)
|
||||||
|
{
|
||||||
|
if ((VehicleHash)client.Vehicle.Model != VehicleHash.Burrito3)
|
||||||
|
return;
|
||||||
|
|
||||||
|
User user = client.GetUser();
|
||||||
|
using (var context = new DatabaseContext())
|
||||||
|
{
|
||||||
|
FactionVehicle factionVehicle = context.FactionVehicles.Where(f => f.FactionId == user.FactionId && f.Model == VehicleHash.Burrito3).FirstOrDefault();
|
||||||
|
Vehicle fVeh = VehicleManager.GetVehicleFromServerVehicle(factionVehicle);
|
||||||
|
fVeh.SetData("weaponDeal", false);
|
||||||
|
fVeh.SetData("WeaponDealLoad", true);
|
||||||
|
InventoryManager.RemoveAllItemsfromVehicleInventory(fVeh);
|
||||||
|
Random rnd = new Random();
|
||||||
|
if(factionVehicle.Id == 8 || factionVehicle.Id == 7)
|
||||||
|
{
|
||||||
|
VehicleItem item = new VehicleItem() { ItemId = 11, VehicleId = factionVehicle.Id, Amount = rnd.Next(45, 100) }; //pistole
|
||||||
|
InventoryManager.AddItemToVehicleInventory(client, item, fVeh);
|
||||||
|
VehicleItem item3 = new VehicleItem() { ItemId = 14, VehicleId = factionVehicle.Id, Amount = rnd.Next(30, 50) }; //Pumpe
|
||||||
|
InventoryManager.AddItemToVehicleInventory(client, item3, fVeh);
|
||||||
|
VehicleItem item2 = new VehicleItem() { ItemId = 16, VehicleId = factionVehicle.Id, Amount = rnd.Next(5, 15) }; //Schutzweste
|
||||||
|
InventoryManager.AddItemToVehicleInventory(client, item2, fVeh);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
ReallifeGamemode.Server/WeaponDeal/WeaponDealPoints.cs
Normal file
36
ReallifeGamemode.Server/WeaponDeal/WeaponDealPoints.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using GTANetworkAPI;
|
||||||
|
using System.Linq;
|
||||||
|
using ReallifeGamemode.Database.Entities;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Server.WeaponDeal
|
||||||
|
{
|
||||||
|
public class WeaponDealPoints
|
||||||
|
{
|
||||||
|
public static Dictionary<int, int> factionWeaponDeal = new Dictionary<int, int>();
|
||||||
|
|
||||||
|
|
||||||
|
private static readonly IReadOnlyCollection<Vector3> WT_Route = new List<Vector3>
|
||||||
|
{
|
||||||
|
new Vector3(2465.163, 1589.396, 32.72029),
|
||||||
|
new Vector3(1532.045, 1702.775, 109.7561),
|
||||||
|
new Vector3(58.67861, 3717.103, 39.75301),
|
||||||
|
new Vector3(-2174.734, 4269.301, 48.95574)
|
||||||
|
}.AsReadOnly();
|
||||||
|
|
||||||
|
public static Vector3 getRndWD_Route(int factionID)
|
||||||
|
{
|
||||||
|
if (!factionWeaponDeal.ContainsKey(factionID))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if(factionWeaponDeal[factionID] == -1)
|
||||||
|
{
|
||||||
|
Random rnd = new Random();
|
||||||
|
factionWeaponDeal[factionID] = rnd.Next(0, WT_Route.Count - 1);
|
||||||
|
}
|
||||||
|
return WT_Route.ElementAt(factionWeaponDeal[factionID]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user