Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop

This commit is contained in:
Michael
2019-10-30 19:27:24 +01:00
41 changed files with 3682 additions and 138 deletions

View File

@@ -4,26 +4,32 @@
* @copyright (c) 2008 - 2018 Life of German
*/
export default function playerList() {
export default function playerList(globalData: GlobalData) {
var playerlistBrowser
var playerlistBrowser: BrowserMp = null;
var pList;
mp.events.add("showPlayerlist", (playersJson) => {
if (!playerlistBrowser) {
playerlistBrowser = mp.browsers.new('package://assets/html/Playerlist/Tabliste.html');
mp.gui.chat.activate(false);
mp.gui.cursor.show(true, true);
pList = JSON.parse(playersJson);
pList.forEach((player) => {
playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,0,'${JSON.stringify(player.Ping)}');`);
});
} else {
if (playerlistBrowser == null) {
if (!globalData.InMenu) {
globalData.InMenu = true;
playerlistBrowser = mp.browsers.new('package://assets/html/Playerlist/Tabliste.html');
mp.gui.chat.activate(false);
mp.gui.cursor.show(true, true);
pList = JSON.parse(playersJson);
pList.forEach((player) => {
playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,0,'${JSON.stringify(player.Ping)}');`);
});
}
} else {
playerlistBrowser.destroy();
playerlistBrowser = null;
mp.gui.chat.activate(true);
mp.gui.cursor.show(false, false);
globalData.InMenu = false;
}
});
mp.events.add("CEF:fetchPlayerList", () => {

View File

@@ -26,16 +26,17 @@ export default function weaponList(globalData: GlobalData) {
var secondaries;
var melees;
var specialsWep;
var time;
var primary = "";
var secondary = "";
var melee = "";
var specialWep = "";
var timer = "";
//Weapon Menu
mp.events.add('showWeaponMenu', (primariesArr, secondariesArr, meleesArr, specialsArr) => {
mp.events.add('showWeaponMenu', (primariesArr, secondariesArr, meleesArr, specialsArr, jsonTime) => {
if (!globalData.InMenu) {
globalData.InMenu = true;
@@ -44,13 +45,19 @@ export default function weaponList(globalData: GlobalData) {
secondaries = secondariesArr;
melees = meleesArr;
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.AddItem(new UIMenuListItem("Sekundäre", "", new ItemsCollection(secondaries)));
weaponMenu = new Menu("Waffenschrank", "Stelle deine Waffenausrüstung zusammen", new Point(50, 50), null, null);
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("Spezial", "", new ItemsCollection(specialsWep)));
weaponMenu.AddItem(dealItem);
weaponMenu.AddItem(saveItem);
weaponMenu.AddItem(cancelItem);
weaponMenu.Visible = true;
@@ -96,6 +103,10 @@ export default function weaponList(globalData: GlobalData) {
} else if (item.Text === "Abbrechen") {
weaponMenu.Close();
globalData.InMenu = false;
} else if (item.Text === "Waffentransport") {
mp.events.callRemote("startWeaponDeal");
weaponMenu.Close();
globalData.InMenu = false;
}
});

View File

@@ -619,7 +619,7 @@ t#tf_nameorid {
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.5vw;
font-size: 0.6vw;
position: relative;
left: 19vw;
top: 13vw;
@@ -634,7 +634,7 @@ t#tf_nameorid {
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
font-size: 0.5vw;
font-color: white;
position: relative;
left: 17.8vw;
@@ -723,7 +723,7 @@ t#tf_nameorid {
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
font-size: 0.5vw;
font-color: white;
position: relative;
left: 17.8vw;
@@ -731,7 +731,7 @@ t#tf_nameorid {
color: #ffffff;
opacity: 0.5;
transition: 0.3s;
}
}i
#tf_cancle3:hover {
opacity: 1
@@ -753,7 +753,7 @@ t#tf_nameorid {
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.5vw;
font-size: 0.6vw;
position: relative;
left: 19vw;
top: 13vw;
@@ -768,7 +768,7 @@ t#tf_nameorid {
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.5vw;
font-size: 0.7vw;
font-color: white;
position: relative;
left: 21vw;
@@ -784,8 +784,8 @@ t#tf_nameorid {
.BoxBlue {
background-color: #1b1b1b;
height: 10vw;
width: 20vw;
height: 11.1vw;
width: 20.2vw;
position: relative;
margin-top: 11vw;
margin-left: 16vw;
@@ -809,12 +809,12 @@ t#tf_nameorid {
#tf_submitZahlToHandel {
background-color: #008CBA;
border: none;
height: 1vw;
height: 1.4vw;
width: 7vw;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.4vw;
font-size: 0.6vw;
position: relative;
left: -3vw;
top: 7vw;
@@ -830,15 +830,15 @@ t#tf_nameorid {
#tf_submitZahlToVehicle {
background-color: #008CBA;
border: none;
height: 1vw;
width: 8vw;
height: 1.3vw;
width: 7.8vw;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.5vw;
font-size: 0.6vw;
position: relative;
left: 10.8vw;
top: 5.95vw;
top: 5.45vw;
color: #ffffff;
opacity: 0.5;
transition: 0.3s;
@@ -871,14 +871,14 @@ select.select_box2 {
.blueIcon1 {
position: relative;
height: 3vw;
margin-bottom: -4vw;
margin-bottom: -3.1vw;
margin-left: 13.4vw;
}
.blueIcon2 {
position: relative;
height: 3vw;
margin-bottom: -3.1vw;
margin-bottom: 0.9vw;
margin-left: 3.4vw;
}
@@ -916,3 +916,56 @@ select.select_box2 {
top: 3vw;
color: #ffffff;
}
.alert_green {
z-index: 2;
background: rgba(85, 255, 0, 0.90);
position: relative;
width: 17vw;
height: 1vw;
margin-left: 74.1vw;
padding-bottom: 3vw;
margin-top: -9.5vw;
font-family: 'OSL';
font-size: 0.9vw;
text-align: center;
line-height: 3.9vw;
}
.alert_red {
z-index: 2;
background: rgba(175, 0, 0, 0.9);
position: relative;
width: 17vw;
height: 1vw;
margin-left: 74.1vw;
padding-bottom: 3vw;
margin-top: -9.5vw;
font-family: 'OSL';
text-align: center;
line-height: 3.9vw;
font-size: 0.7vw;
display: none;
}
.alert_blue {
z-index: 2;
background: rgba(0, 140, 186, 0.90);
position: relative;
width: 17vw;
height: 1vw;
margin-left: 74.1vw;
padding-bottom: 3vw;
margin-top: -9.5vw;
font-family: 'OSL';
text-align: center;
line-height: 3.9vw;
font-size: 0.7vw;
display: none;
}
.alerts {
margin-bottom: 47.5vw;
padding-top: 43.3vw;
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -10,11 +10,15 @@
<body>
<div class="alerts" id='alertbox'>
</div>
<div class="sidebar">
<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="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="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>
@@ -109,6 +113,14 @@
}
}
function getVehicle() {
if (vehInv.length > 0) {
switchSite('vehClass');
} else {
mp.trigger("Error", "Kofferraum leer oder kein Fahrzeug in der Nähe.")
}
}
$("#tf_acceptTrade").unbind('click').click(function () {
if (anfrageInv.length > 0) {
mp.trigger("CEF:acceptTrade");
@@ -252,7 +264,7 @@
var redButton = document.createElement("div");
var redButtonImg = document.createElement("img");
redButton.setAttribute("class", "red");
redButton.setAttribute("onclick", "onAction(1," + item.ID + "," + item.Amount + ");");
redButton.setAttribute("onclick", "onAction(1," + item.ID + "," + item.Amount + ","+ i +");");
redButtonImg.setAttribute("src", "img/backpack/trash.svg");
redButtonImg.setAttribute("class", "redImg");
redButton.appendChild(redButtonImg);
@@ -261,7 +273,7 @@
var blueButton = document.createElement("div");
var blueButtonImg = document.createElement("img");
blueButton.setAttribute("class", "blue2");
blueButton.setAttribute("onclick", "onAction(4," + item.ID + "," + item.Amount + ");");
blueButton.setAttribute("onclick", "onAction(4," + item.ID + "," + item.Amount + ","+ i +");");
blueButtonImg.setAttribute("src", "img/backpack/paper-plane.svg");
blueButtonImg.setAttribute("class", "blueImg");
blueButton.appendChild(blueButtonImg);
@@ -375,26 +387,104 @@
var clnc = 1;
function alertGreen(JsonAmount, JsonName) {
var amount = JSON.parse(JsonAmount);
var name = JSON.parse(JsonName);
var list = document.getElementById("alertbox");
var Litem = document.createElement("div");
Litem.setAttribute("class", "alert_green");
Litem.appendChild(document.createTextNode("Du hast " + amount + "x " + name + " benutzt."));
$(Litem).hide().appendTo(list).fadeIn(500);
$(Litem).fadeIn(500);
setTimeout(function () {
$(Litem).fadeOut(500, function () {
$(Litem).remove();
});
}, 5000);
}
function alertRed(JsonAmount, JsonName) {
var amount = JSON.parse(JsonAmount);
var name = JSON.parse(JsonName);
var list = document.getElementById("alertbox");
var Litem = document.createElement("div");
Litem.setAttribute("class", "alert_red");
Litem.appendChild(document.createTextNode("Du hast " + amount + "x " + name + " weggeworfen."));
$(Litem).hide().appendTo(list).fadeIn(500);
$(Litem).fadeIn(500);
setTimeout(function () {
$(Litem).fadeOut(500, function () {
$(Litem).remove();
});
}, 5000);
}
function alertError(jsonString) {
var string = JSON.parse(jsonString);
var list = document.getElementById("alertbox");
var Litem = document.createElement("div");
Litem.setAttribute("class", "alert_red");
Litem.appendChild(document.createTextNode(string));
$(Litem).hide().appendTo(list).fadeIn(500);
$(Litem).fadeIn(500);
setTimeout(function () {
$(Litem).fadeOut(500, function () {
$(Litem).remove();
});
}, 5000);
}
function alertBlue(JsonAmount, JsonName, JsonTransferInv) {
var amount = JSON.parse(JsonAmount);
var name = JSON.parse(JsonName);
var transferInv = JSON.parse(JsonTransferInv);
var list = document.getElementById("alertbox");
var Litem = document.createElement("div");
Litem.setAttribute("class", "alert_blue");
Litem.appendChild(document.createTextNode("Du hast " + amount + "x " + name + " ins "+transferInv+" transferiert."));
$(Litem).hide().appendTo(list).fadeIn(500);
$(Litem).fadeIn(500);
setTimeout(function () {
$(Litem).fadeOut(500, function () {
$(Litem).remove();
});
}, 5000);
}
function removeItems(JsonId, JsonAmount) {
var amount = JSON.parse(JsonAmount);
var id = JSON.parse(JsonId);
console.log("start : " + amount +" " + id);
for (var i = 0; i < rucksackInv.length; i++) {
console.log(i);
if (rucksackInv[i].ID == id) {
console.log("in Arr : " + i);
if (rucksackInv[i].Amount > amount) {
rucksackInv[i].Amount -= amount;
} else if (rucksackInv[i].Amount <= amount) {
rucksackInv.splice(i, 1);
}
drawRucksack();
return;
}
}
}
function onAction(action, id, ammount, i) {
$(".Betrag").hide();
if (action == 0)//green
{
$(".Betrag").show();
$("#tf_submitZahl").unbind('click').click(function () {
if ($('#tf_zahl').val() < ammount && ammount > 0) {
rucksackInv[i].Amount -= $('#tf_zahl').val();
} else if ($('#tf_zahl').val() >= ammount) {
rucksackInv.splice(i, 1);
}
console.log(i);
$(".Betrag").hide();
drawRucksack();
event.preventDefault()
event.stopPropagation()
});
mp.trigger("CEF:useItem", JSON.stringify("use"), JSON.stringify(0), JSON.stringify(id))
}
if (action == 1)//red
{
@@ -402,14 +492,10 @@
$("#tf_submitZahl").unbind('click').click(function () {
if ($('#tf_zahl').val() < ammount && ammount > 0) {
rucksackInv[i].Amount -= $('#tf_zahl').val();
mp.trigger("CEF:throwItem", JSON.stringify("drop"), JSON.stringify($('#tf_zahl').val()), JSON.stringify(rucksackInv[i].ID))
mp.trigger("CEF:useItem", JSON.stringify("drop"), JSON.stringify($('#tf_zahl').val()), JSON.stringify(rucksackInv[i].ID))
} else if ($('#tf_zahl').val() >= ammount) {
mp.trigger("CEF:throwItem", JSON.stringify("drop"), JSON.stringify(ammount), JSON.stringify(rucksackInv[i].ID))
rucksackInv.splice(i, 1);
mp.trigger("CEF:useItem", JSON.stringify("drop"), JSON.stringify(ammount), JSON.stringify(rucksackInv[i].ID))
}
console.log(i);
$(".Betrag").hide();
drawRucksack();
drawVehicle();
@@ -473,7 +559,7 @@
event.stopPropagation()
return;
}
Origin[0] = 0;
var y = parseInt($('#tf_zahl2').val(), 10);
if ($('#tf_zahl2').val() < ammount && ammount > 0) {
@@ -549,7 +635,7 @@
} else if ($('#tf_zahl3').val() >= ammount) {
for (x = 0; x < rucksackInv.length; x++) {
if (rucksackInv[x].ID == Copy.ID) {
rucksackInv[x].Amount += y;
rucksackInv[x].Amount += ammount;
handelInv.splice(i, 1);
$(".Betrag3").hide();
drawHandel();
@@ -574,37 +660,39 @@
$(".Betrag4").show();
var Copy = Object.assign({}, vehInv[i]);
$("#tf_submitZahl4").unbind('click').click(function () {
Origin[0] = 1;
var y = parseInt($('#tf_zahl4').val(), 10);
if ($('#tf_zahl4').val() < ammount && ammount > 0) {
for (x = 0; x < rucksackInv.length; x++) {
if (rucksackInv[x].ID == Copy.ID) {
rucksackInv[x].Amount += y;
vehInv[i].Amount -= y;
$(".Betrag2").hide();
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(vehInv[i].Amount), JSON.stringify(y));
drawVehicle();
drawRucksack();
drawVehicle();
event.preventDefault()
event.stopPropagation()
return;
}
}
console.log(rucksackInv);
rucksackInv.push(Copy);
rucksackInv[rucksackInv.length - 1].Amount = y;
rucksackInv[rucksackInv.length - 1].Category = 2;
vehInv[i].Amount -= y;
mp.trigger("CEF:saveVehicleTransfer",0, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(vehInv[i].Amount), JSON.stringify(y));
console.log(rucksackInv);
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(vehInv[i].Amount), JSON.stringify(y));
} else if ($('#tf_zahl4').val() >= ammount) {
for (x = 0; x < rucksackInv.length; x++) {
if (rucksackInv[x].ID == Copy.ID) {
rucksackInv[x].Amount += y;
rucksackInv[x].Amount += ammount;
vehInv.splice(i, 1);
$(".Betrag2").hide();
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(0), JSON.stringify(ammount));
drawVehicle();
drawRucksack();
drawVehicle();
event.preventDefault()
event.stopPropagation()
return;
@@ -612,13 +700,16 @@
}
rucksackInv.push(Copy);
rucksackInv[rucksackInv.length - 1].Amount = ammount;
rucksackInv[rucksackInv.length - 1].Category = 2;
vehInv.splice(i, 1);
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(0), JSON.stringify(ammount));
}
$(".Betrag4").hide();
drawVehicle();
drawRucksack();
drawVehicle();
event.preventDefault()
event.stopPropagation()
});
@@ -787,7 +878,7 @@
var redButton = document.createElement("div");
var redButtonImg = document.createElement("img");
redButton.setAttribute("class", "red");
redButton.setAttribute("onclick", "onAction(1," + item.ID + "," + item.Amount + ");");
redButton.setAttribute("onclick", "onAction(1," + item.ID + "," + item.Amount + ","+ i +");");
redButtonImg.setAttribute("src", "img/backpack/trash.svg");
redButtonImg.setAttribute("class", "redImg");
redButton.appendChild(redButtonImg);
@@ -796,7 +887,7 @@
var blueButton = document.createElement("div");
var blueButtonImg = document.createElement("img");
blueButton.setAttribute("class", "blue2");
blueButton.setAttribute("onclick", "onAction(4," + item.ID + "," + item.Amount + ");");
blueButton.setAttribute("onclick", "onAction(4," + item.ID + "," + item.Amount + ","+ i +");");
blueButtonImg.setAttribute("src", "img/backpack/paper-plane.svg");
blueButtonImg.setAttribute("class", "blueImg");
blueButton.appendChild(blueButtonImg);

View File

@@ -2,6 +2,7 @@
var errorShown = false;
$(document).ready(_ => {
mp.trigger("CEF:Login_RequestPlayerName");

View File

@@ -80,7 +80,7 @@ Infobox(globalData);
//nametags();
import playerList from './Gui/playerlist';
playerList();
playerList(globalData);

View File

@@ -78,14 +78,45 @@ export default function inventory(globalData: GlobalData): void {
});
mp.events.add("CEF:invThrowItem", (itemId, amount) => {
mp.events.callRemote('invThrowItem', itemId, amount);
});
mp.events.add("CEF:throwItem", (type, amount, id) => {
mp.events.add("CEF:useItem", (type, amount, id) => {
mp.events.callRemote("itemInteract", type, amount, id);
});
mp.events.add("removeItem", (id, amount) => {
if (invBrowser !== null) {
invBrowser.execute(`removeItems('${JSON.stringify(id)}','${JSON.stringify(amount)}')`);
}
});
mp.events.add("aproveUse", (amount, name) => {
if (invBrowser !== null) {
mp.game.audio.playSoundFrontend(1, "LOCAL_PLYR_CASH_COUNTER_COMPLETE", "DLC_HEISTS_GENERAL_FRONTEND_SOUNDS", true);
invBrowser.execute(`alertGreen('${JSON.stringify(amount)}','${JSON.stringify(name)}')`);
}
});
mp.events.add("aproveThrow", (amount, name) => {
if (invBrowser !== null) {
mp.game.audio.playSoundFrontend(1, "ERROR", "HUD_AMMO_SHOP_SOUNDSET", true);
invBrowser.execute(`alertRed('${JSON.stringify(amount)}','${JSON.stringify(name)}')`);
}
});
mp.events.add("aproveTransfer", (amount, name, where) => {
if (invBrowser !== null) {
mp.game.audio.playSoundFrontend(1, "ERROR", "HUD_AMMO_SHOP_SOUNDSET", true);
invBrowser.execute(`alertBlue('${JSON.stringify(amount)}','${JSON.stringify(name)}','${JSON.stringify(where)}')`);
}
});
mp.events.add("Error", (msg) => {
if (invBrowser !== null) {
mp.game.audio.playSoundFrontend(1, "ERROR", "HUD_AMMO_SHOP_SOUNDSET", true);
invBrowser.execute(`alertError('${JSON.stringify(msg)}')`);
}
});
mp.events.add("CEF:InventoryLoaded", () => {
if (offer == 1) {
invBrowser.execute(`changeTradeStatus('${JSON.stringify(offer)}')`);
@@ -101,6 +132,7 @@ export default function inventory(globalData: GlobalData): void {
mp.events.callRemote('getNearVehicles');
});
mp.events.add("CEF:acceptTrade", () => {
if (invBrowser !== null) {
mp.events.callRemote('acceptTrade');

View File

@@ -20,6 +20,7 @@ namespace ReallifeGamemode.Database.Entities
[StringLength(32)]
public string Name { get; set; }
public bool StateOwned { get; set; }
public int WeaponDealTime { get; set; } = 60;
public IBankAccount GetBankAccount(DatabaseContext databaseContext = null)
{

View File

@@ -20,5 +20,6 @@ namespace ReallifeGamemode.Database.Entities
public string WeaponModel { get; set; }
public int SlotID { get; set; }
public int Rank { get; set; }
public int Ammount { get; set; }
}
}

View File

@@ -88,7 +88,7 @@ namespace ReallifeGamemode.Database.Entities
public int JailTime { get; set; }
public int PaydayTimer { get; set; }
public int PaydayTimer { get; set; } = 60;
public bool DriverLicenseVehicle { get; set; }

File diff suppressed because it is too large Load Diff

View File

@@ -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);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Database.Migrations
{
public partial class FactionWeaponAmount : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Ammount",
table: "FactionWeapons",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Ammount",
table: "FactionWeapons");
}
}
}

View File

@@ -356,6 +356,8 @@ namespace ReallifeGamemode.Database.Migrations
b.Property<bool>("StateOwned");
b.Property<int>("WeaponDealTime");
b.HasKey("Id");
b.ToTable("Factions");
@@ -408,6 +410,8 @@ namespace ReallifeGamemode.Database.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("Ammount");
b.Property<int?>("FactionId");
b.Property<int>("Rank");

View File

@@ -2492,9 +2492,9 @@ namespace ReallifeGamemode.Server.Commands
option1 = option1.ToString();
if (option1 != "add" && option1 != "remove" && option1 != "setenterposition" && option1 != "setexitposition")
if (option1 != "add" && option1 != "remove" && option1 != "setenter" && option1 != "setexit")
{
ChatService.SendMessage(player, "~m~Benutzung: ~s~/interior [Add / Remove / SetEnter / SetExit] [Name]");
ChatService.SendMessage(player, "~m~Benutzung: ~s~/interior [Add / Remove / SetEnter / SetExit] [Name / ID]");
return;
}

View File

@@ -68,13 +68,13 @@ namespace ReallifeGamemode.Server.DrivingSchool
public static void Setup()
{
informationLabel = NAPI.TextLabel.CreateTextLabel("Fahrschule", new Vector3(-815.8334, -1346.405, 5.150263), 20.0f, 1.3f, 0, new Color(255, 255, 255));
marker = NAPI.Marker.CreateMarker(MarkerType.VerticalCylinder, new Vector3(-815.8334, -1346.405, 4.150263), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255));
informationLabel = NAPI.TextLabel.CreateTextLabel("Fahrschule", new Vector3(-813.17, -1354.5, 5.14), 20.0f, 1.3f, 0, new Color(255, 255, 255));
marker = NAPI.Marker.CreateMarker(MarkerType.VerticalCylinder, new Vector3(-813.17, -1354.5, 4.14), new Vector3(), new Vector3(), 1f, new Color(255, 255, 255));
_colShape = NAPI.ColShape.CreateSphereColShape(new Vector3(-815.8334, -1346.405, 5.150263), 3f);
_colShape = NAPI.ColShape.CreateSphereColShape(new Vector3(-813.17, -1354.5, 5.14), 3f);
_colShape.OnEntityEnterColShape += EntityEnterBusinessColShape;
_colShape.OnEntityExitColShape += EntityExitBusinessColShape;
NAPI.Blip.CreateBlip(545, new Vector3(-815.8334, -1346.405, 5.150263), 1.0f, 4, "Fahrschule", shortRange: true);
NAPI.Blip.CreateBlip(545, new Vector3(-813.17, -1354.5, 5.14), 1.0f, 4, "Fahrschule", shortRange: true);
}
private static void EntityEnterBusinessColShape(ColShape colShape, Client client)

View 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, GTANetworkAPI.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");
}
}
}
}
}

View File

@@ -4,6 +4,7 @@ using System.Text;
using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.WeaponDeal;
namespace ReallifeGamemode.Server.Events
{
@@ -25,6 +26,11 @@ namespace ReallifeGamemode.Server.Events
{
if (veh.FactionId != player.GetUser().FactionId)
{
if ((VehicleHash)vehicle.Model == VehicleHash.Burrito3)
{
if (WeaponDealManager.checkWeaponDbyVehicle(vehicle))
return;
}
player.StopAnimation();
player.SendNotification("~r~Du darfst dieses Fahrzeug nicht benutzen!", true);
return;

View 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, GTANetworkAPI.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");
}
}
}
}
}

View File

@@ -9,6 +9,7 @@ using ReallifeGamemode.Server.Extensions;
using ReallifeGamemode.Server.Inventory.Interfaces;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
using Newtonsoft.Json;
namespace ReallifeGamemode.Server.Events
{
@@ -18,53 +19,62 @@ namespace ReallifeGamemode.Server.Events
public void SrvEvent_GetNearVehicles(Client client)
{
var user = client.GetUser();
var inventoryWeight = 0;
List<VehicleInventory> vehicleInventory = new List<VehicleInventory>();
if (!client.IsInVehicle)
{
using (var context = new DatabaseContext())
{
foreach (GTANetworkAPI.Vehicle veh in NAPI.Pools.GetAllVehicles())
{
List<string> iName = new List<string>();
List<int> iAmount = new List<int>();
List<int> iId = new List<int>();
inventoryWeight = 0;
if (veh.Position.DistanceTo(client.Position) < 2.5f)
List<VehicleInventory> vehicleInventory = new List<VehicleInventory>();
if (veh.Position.DistanceTo(client.Position) < 5f)
{
if (VehicleStreaming.GetDoorState(veh, DoorID.DoorTrunk) == DoorState.DoorOpen)
if (VehicleStreaming.GetDoorState(veh, DoorID.DoorTrunk) == DoorState.DoorOpen || VehicleStreaming.GetDoorState(veh, DoorID.DoorRearLeft) == DoorState.DoorOpen || VehicleStreaming.GetDoorState(veh, DoorID.DoorRearRight) == DoorState.DoorOpen)
{
ServerVehicle serverVehicle = VehicleManager.GetServerVehicleFromVehicle(veh, context);
List<VehicleItem> vehicleItems = context.VehicleItems.ToList().FindAll(i => i.VehicleId == serverVehicle.Id);
foreach (var vehItem in vehicleItems)
{
IItem iItem = InventoryManager.GetItemById(vehItem.ItemId);
var currentItemWeight = iItem.Gewicht * vehItem.Amount;
inventoryWeight += currentItemWeight;
iName.Add(iItem.Name);
iAmount.Add(vehItem.Amount);
iId.Add(iItem.Id);
}
var vehInv = new VehicleInventory
{
ID = serverVehicle.Id,
currentWeight = inventoryWeight,
totalWeight = 250,
ivehName = iName.ToArray(),
ivehAmount = iAmount.ToArray(),
ivehId = iId.ToArray()
};
vehicleInventory.Add(vehInv);
vehicleInventory = getVehItem(veh);
}
client.TriggerEvent("setVehiclesInventory", vehicleInventory.ToArray());
client.TriggerEvent("setVehiclesInventory", vehicleInventory.ToArray());
return;
}
}
}
}
}
public List<VehicleInventory> getVehItem(GTANetworkAPI.Vehicle veh)
{
List<string> iName = new List<string>();
List<int> iAmount = new List<int>();
List<int> iId = new List<int>();
List<VehicleInventory> vehicleInventory = new List<VehicleInventory>();
var inventoryWeight = 0;
using (var context = new DatabaseContext())
{
ServerVehicle serverVehicle = VehicleManager.GetServerVehicleFromVehicle(veh, context);
List<VehicleItem> vehicleItems = context.VehicleItems.ToList().FindAll(i => i.VehicleId == serverVehicle.Id);
foreach (var vehItem in vehicleItems)
{
IItem iItem = InventoryManager.GetItemById(vehItem.ItemId);
var currentItemWeight = iItem.Gewicht * vehItem.Amount;
inventoryWeight += currentItemWeight;
iName.Add(iItem.Name);
iAmount.Add(vehItem.Amount);
iId.Add(iItem.Id);
}
var vehInv = new VehicleInventory
{
ID = serverVehicle.Id,
currentWeight = inventoryWeight,
totalWeight = 250,
ivehName = iName.ToArray(),
ivehAmount = iAmount.ToArray(),
ivehId = iId.ToArray()
};
vehicleInventory.Add(vehInv);
}
return vehicleInventory;
}
}
}

View File

@@ -13,6 +13,7 @@ using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Database;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Server.Inventory.Interfaces;
/**
* @overview Life of German Reallife - Event Key (Key.cs)
* @author VegaZ
@@ -229,17 +230,47 @@ namespace ReallifeGamemode.Server.Events
List<string> secondarys = new List<string>();
List<string> melees = new List<string>();
List<string> specials = new List<string>();
List<string> timer = new List<string>();
string dealTime = "Starten";
primarys.Add("Keine");
secondarys.Add("Keine");
melees.Add("Keine");
specials.Add("Keine");
using (var context = new DatabaseContext())
{
List<UserItem> fItem = context.UserItems.Where(u => u.UserId == user.Id).ToList();
foreach(var item in fItem)
{
IItem iItem = InventoryManager.GetItemById(item.ItemId);
if(iItem is IWeaponDealItem obj)
{
FactionWeapon weapon = context.FactionWeapons.Where(w => w.FactionId == user.FactionId && w.WeaponModel == iItem.Name).FirstOrDefault();
if (weapon == null)
continue;
weapon.Ammount += item.Amount;
ChatService.SendMessage(player, item.Amount + " " + iItem.Name + " wurden im Waffenlager hinzugefürgt.");
context.Remove(item);
}
}
context.SaveChanges();
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)
{
if (weapon.Ammount <= 0)
continue;
switch (weapon.SlotID)
{
case 1:
@@ -262,7 +293,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)
{

View File

@@ -1,4 +1,9 @@
using GTANetworkAPI;
using System.Collections.Generic;
using System.Linq;
using GTANetworkAPI;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Extensions;
namespace ReallifeGamemode.Server.Events
{
@@ -63,10 +68,10 @@ namespace ReallifeGamemode.Server.Events
if (meleeModel.Contains("mk2") && !meleeModel.Contains("_mk2")) meleeModel = meleeModel.Replace("mk2", "_mk2");
melee = NAPI.Util.GetHashKey($"weapon_{meleeModel}");
}
client.GiveWeapon((WeaponHash)primary, 150);
client.GiveWeapon((WeaponHash)secondary, 600);
client.GiveWeapon((WeaponHash)primary, 50);
client.GiveWeapon((WeaponHash)secondary, 150);
client.GiveWeapon((WeaponHash)melee, 1);
if(specialModel != "Schutzweste")
{
@@ -77,9 +82,29 @@ namespace ReallifeGamemode.Server.Events
special = NAPI.Util.GetHashKey($"weapon_{specialModel}");
}
client.GiveWeapon((WeaponHash)special, 50);
return;
}
client.Armor = 100;
else
{
client.Armor = 50;
}
using(var context = new DatabaseContext())
{
User user = client.GetUser();
FactionWeapon slot1 = context.FactionWeapons.Where(w => w.FactionId == user.FactionId && w.WeaponModel == primaryModel).FirstOrDefault();
if (slot1 != null)
slot1.Ammount -= 1;
FactionWeapon slot2 = context.FactionWeapons.Where(w => w.FactionId == user.FactionId && w.WeaponModel == secondaryModel).FirstOrDefault();
if (slot2 != null)
slot2.Ammount -= 1;
FactionWeapon slot3 = context.FactionWeapons.Where(w => w.FactionId == user.FactionId && w.WeaponModel == meleeModel).FirstOrDefault();
if (slot3 != null)
slot3.Ammount -= 1;
FactionWeapon slot4 = context.FactionWeapons.Where(w => w.FactionId == user.FactionId && w.WeaponModel == specialModel).FirstOrDefault();
if (slot4 != null)
slot4.Ammount -= 1;
context.SaveChanges();
}
}
}
}

View File

@@ -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);
}
}

View 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
}
}

View 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 Pistol50 : WeaponDealItem
{
public override int Id => 11;
public override string Name => "Pistol50";
public override string Description => "Waffe";
public override int Gewicht => 1180;
public override string Einheit => "g";
public override uint Object => 3666746839; //3061944032
}
}

View 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
}
}

View 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
}
}

View 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
}
}

View 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
}
}

View 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;
}
}
}

View File

@@ -7,6 +7,7 @@ using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Server.Wanted;
using ReallifeGamemode.Server.DrivingSchool;
using ReallifeGamemode.Server.WeaponDeal;
/**
* @overview Life of German Reallife - Main Class (Main.cs)
@@ -77,6 +78,7 @@ namespace ReallifeGamemode.Server
WantedEscapeTimer.WantedTimer();
Jail.JailTimer();
Economy.PaydayTimer();
WeaponDealManager.WeaponDealTimer();
}
}

View File

@@ -137,6 +137,26 @@ namespace ReallifeGamemode.Server.Managers
return inventoryWeight;
}
public static int GetVehicleInventoryWeight(Vehicle veh)
{
var inventoryWeight = 0;
using (var context = new DatabaseContext())
{
ServerVehicle serverVehicle = VehicleManager.GetServerVehicleFromVehicle(veh, context);
List<VehicleItem> vehItems = context.VehicleItems.ToList().FindAll(i => i.VehicleId == serverVehicle.Id);
foreach (var item in vehItems)
{
IItem iItem = GetItemById(item.ItemId);
var currentItemWeight = iItem.Gewicht * item.Amount;
inventoryWeight += currentItemWeight;
}
}
return inventoryWeight;
}
public static UserItem UserHasThisItem(Client player, int itemId)
{
var user = player.GetUser();
@@ -190,9 +210,9 @@ namespace ReallifeGamemode.Server.Managers
{
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 || VehicleStreaming.GetDoorState(veh, DoorID.DoorRearLeft) == DoorState.DoorOpen || VehicleStreaming.GetDoorState(veh, DoorID.DoorRearRight) == DoorState.DoorOpen)
{
UserItem vItem = new UserItem
@@ -207,6 +227,25 @@ namespace ReallifeGamemode.Server.Managers
VehicleItem vehItem = context.VehicleItems.Where(v => v.VehicleId == origin[1] && v.ItemId == vItem.ItemId).FirstOrDefault();
if (vehItem != null)
{
IItem iItem = GetItemById(vItem.ItemId);
if (GetUserInventoryWeight(client) + (iItem.Gewicht * vItem.Amount) > 40000)
{
for(int i = 0; i <= vItem.Amount; i++)
{
if(GetUserInventoryWeight(client) + (iItem.Gewicht * i) > 40000) {
vItem.Amount = i - 1;
break;
}
}
}
if(vItem.Amount == 0)
{
return false;
}
if (itemAmount < vehItem.Amount)
{
UserItem uItem = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == vItem.ItemId).FirstOrDefault();
@@ -251,8 +290,33 @@ namespace ReallifeGamemode.Server.Managers
VehicleId = origin[1],
Slot = -1,
};
UserItem uItem = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == cItem.ItemId).FirstOrDefault();
IItem iItem = GetItemById(cItem.ItemId);
Vehicle veh = VehicleManager.GetVehicleFromId(cItem.VehicleId);
if (GetVehicleInventoryWeight(veh) + (iItem.Gewicht * cItem.Amount) > 250000)
{
for (int i = 0; i <= cItem.Amount; i++)
{
if (GetVehicleInventoryWeight(veh) + (iItem.Gewicht * i) > 250000)
{
cItem.Amount = i - 1;
break;
}
}
}
if (cItem.Amount == 0)
{
return false;
}
if (iItem is IWeaponDealItem weaponDealItem)
{
return false;
}
if (uItem != null)
{
if (vehAmount < uItem.Amount)
@@ -306,7 +370,6 @@ namespace ReallifeGamemode.Server.Managers
using (var context = new DatabaseContext())
{
VehicleItem vItem = new VehicleItem
{
Amount = itemAmount,
@@ -329,7 +392,8 @@ namespace ReallifeGamemode.Server.Managers
vehItem.Amount = vItem.Amount;
}
context.SaveChanges();
IItem iItem = GetItemById(vItem.ItemId);
player.TriggerEvent("aproveTransfer", JsonConvert.DeserializeObject<int>(vehAmount), iItem.Name, "Rucksack");
}
}
@@ -341,6 +405,7 @@ namespace ReallifeGamemode.Server.Managers
var user = player.GetUser();
var itemID = JsonConvert.DeserializeObject<int>(jsonItemID);
var itemAmount = JsonConvert.DeserializeObject<int>(jsonItemAmount);
var origin = JsonConvert.DeserializeObject<int[]>(jsonGotFrom);
if (!CheckOriginOfItem(player,jsonItemID, jsonItemAmount,jsonGotFrom, vehAmount))
return;
@@ -355,7 +420,9 @@ namespace ReallifeGamemode.Server.Managers
UserId = user.Id,
Slot = -1,
};
UserItem item = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == cItem.ItemId).FirstOrDefault();
UserItem item = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == cItem.ItemId).FirstOrDefault();
if (item == null)
{
context.UserItems.Add(cItem);
@@ -370,6 +437,8 @@ namespace ReallifeGamemode.Server.Managers
}
context.SaveChanges();
IItem iItem = GetItemById(item.ItemId);
player.TriggerEvent("aproveTransfer", JsonConvert.DeserializeObject<int>(vehAmount), iItem.Name, "Kofferraum");
}
}
@@ -407,6 +476,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")]
public void RemoveAsAdminInventory(Client player, string amount, string userItemId, string targetPlayerName)
{
@@ -449,47 +565,56 @@ namespace ReallifeGamemode.Server.Managers
switch (type)
{
case "use":
ChatService.SendMessage(player, "use item: " + iItem.Name);
if (iItem == null)
{
ChatService.SendMessage(player, "Dieses Essen existiert nicht.");
player.TriggerEvent("Error", "Dieses Essen existiert nicht.");
return;
}
if (fItem == null)
{
ChatService.SendMessage(player, "Du hast dieses Item nicht");
player.TriggerEvent("Error", "Du hast dieses Item nicht");
return;
}
if (iItem is IUsableItem usableItemObj)
{
usableItemObj.Use(fItem);
player.TriggerEvent("removeItem", itemId, amount);
player.TriggerEvent("removeItem", itemId, 1);
player.TriggerEvent("aproveUse", 1, iItem.Name);
}
else ChatService.SendMessage(player, "Du kannst dieses Item nicht benutzen.");
else player.TriggerEvent("Error", "Du kannst dieses Item nicht benutzen.");
break;
case "drop":
if (iItem == null)
{
ChatService.SendMessage(player, "Dieses Item existiert nicht.");
player.TriggerEvent("Error", "Dieses Item existiert nicht.");
return;
}
if (fItem == null)
{
ChatService.SendMessage(player, "Du hast dieses Item nicht");
player.TriggerEvent("Error", "Du hast dieses Item nicht");
return;
}
if (iItem is IDroppableItem usableItemObj2)
{
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);
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 };
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);
@@ -500,7 +625,8 @@ namespace ReallifeGamemode.Server.Managers
{
context.UserItems.Remove(fItem);
}
player.TriggerEvent("removeItem", itemId, amount);
player.TriggerEvent("aproveThrow", amount, iItem.Name);
}
break;
}

View File

@@ -0,0 +1,108 @@
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;
Faction fac = context.Factions.Where(f => f.Id == user.FactionId).FirstOrDefault();
fac.WeaponDealTime = 60;
context.SaveChanges();
}
else
{
ChatService.ErrorMessage(client, "Du kannst noch kein Waffendeal starten");
}
}
}
public static void WeaponDealTimer()
{
System.Timers.Timer timer = new System.Timers.Timer(60000);
timer.Start();
timer.Elapsed += Timer_Elapsed;
}
private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
using(var context = new DatabaseContext())
{
List<Faction> fac = context.Factions.ToList<Faction>();
foreach(var faction in fac)
{
if (faction.WeaponDealTime > 0)
faction.WeaponDealTime -= 1;
}
context.SaveChanges();
}
}
[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.FactionId == 8 || factionVehicle.FactionId == 7)
{
VehicleItem item = new VehicleItem() { ItemId = 11, VehicleId = factionVehicle.Id, Amount = rnd.Next(45, 75) }; //pistole
InventoryManager.AddItemToVehicleInventory(client, item, fVeh);
VehicleItem item3 = new VehicleItem() { ItemId = 14, VehicleId = factionVehicle.Id, Amount = rnd.Next(30, 40) }; //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);
}
}
}
}
}

View File

@@ -0,0 +1,39 @@
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), ungeeignet
new Vector3(1532.045, 1702.775, 109.7561), //Hütte iwo Östlich
new Vector3(58.67861, 3717.103, 39.75301), //Lost MC
new Vector3(-2174.734, 4269.301, 48.95574), //Army Base
new Vector3(2530.14, 2617.15, 37.76),
new Vector3(-3179.78, 820.08, 3.59),
new Vector3(-1889.91, 2045.6, 140.68)
}.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]);
}
}
}