Finish WeaponDeal System - Improved Inventory
This commit is contained in:
@@ -4,13 +4,16 @@
|
|||||||
* @copyright (c) 2008 - 2018 Life of German
|
* @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;
|
var pList;
|
||||||
|
|
||||||
mp.events.add("showPlayerlist", (playersJson) => {
|
mp.events.add("showPlayerlist", (playersJson) => {
|
||||||
if (!playerlistBrowser) {
|
|
||||||
|
if (playerlistBrowser == null) {
|
||||||
|
if (!globalData.InMenu) {
|
||||||
|
globalData.InMenu = true;
|
||||||
playerlistBrowser = mp.browsers.new('package://assets/html/Playerlist/Tabliste.html');
|
playerlistBrowser = mp.browsers.new('package://assets/html/Playerlist/Tabliste.html');
|
||||||
mp.gui.chat.activate(false);
|
mp.gui.chat.activate(false);
|
||||||
mp.gui.cursor.show(true, true);
|
mp.gui.cursor.show(true, true);
|
||||||
@@ -18,12 +21,15 @@ export default function playerList() {
|
|||||||
pList.forEach((player) => {
|
pList.forEach((player) => {
|
||||||
playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,0,'${JSON.stringify(player.Ping)}');`);
|
playerlistBrowser.execute(`ad_row('${JSON.stringify(player.Id)}','${JSON.stringify(player.Name)}',0,0,'${JSON.stringify(player.Ping)}');`);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
playerlistBrowser.destroy();
|
playerlistBrowser.destroy();
|
||||||
playerlistBrowser = null;
|
playerlistBrowser = null;
|
||||||
mp.gui.chat.activate(true);
|
mp.gui.chat.activate(true);
|
||||||
mp.gui.cursor.show(false, false);
|
mp.gui.cursor.show(false, false);
|
||||||
|
globalData.InMenu = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CEF:fetchPlayerList", () => {
|
mp.events.add("CEF:fetchPlayerList", () => {
|
||||||
|
|||||||
@@ -619,7 +619,7 @@ t#tf_nameorid {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 0.5vw;
|
font-size: 0.6vw;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 19vw;
|
left: 19vw;
|
||||||
top: 13vw;
|
top: 13vw;
|
||||||
@@ -634,7 +634,7 @@ t#tf_nameorid {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 16px;
|
font-size: 0.5vw;
|
||||||
font-color: white;
|
font-color: white;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 17.8vw;
|
left: 17.8vw;
|
||||||
@@ -723,7 +723,7 @@ t#tf_nameorid {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 16px;
|
font-size: 0.5vw;
|
||||||
font-color: white;
|
font-color: white;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 17.8vw;
|
left: 17.8vw;
|
||||||
@@ -731,7 +731,7 @@ t#tf_nameorid {
|
|||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
transition: 0.3s;
|
transition: 0.3s;
|
||||||
}
|
}i
|
||||||
|
|
||||||
#tf_cancle3:hover {
|
#tf_cancle3:hover {
|
||||||
opacity: 1
|
opacity: 1
|
||||||
@@ -753,7 +753,7 @@ t#tf_nameorid {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 0.5vw;
|
font-size: 0.6vw;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 19vw;
|
left: 19vw;
|
||||||
top: 13vw;
|
top: 13vw;
|
||||||
@@ -768,7 +768,7 @@ t#tf_nameorid {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 0.5vw;
|
font-size: 0.7vw;
|
||||||
font-color: white;
|
font-color: white;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 21vw;
|
left: 21vw;
|
||||||
@@ -784,8 +784,8 @@ t#tf_nameorid {
|
|||||||
|
|
||||||
.BoxBlue {
|
.BoxBlue {
|
||||||
background-color: #1b1b1b;
|
background-color: #1b1b1b;
|
||||||
height: 10vw;
|
height: 11.1vw;
|
||||||
width: 20vw;
|
width: 20.2vw;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 11vw;
|
margin-top: 11vw;
|
||||||
margin-left: 16vw;
|
margin-left: 16vw;
|
||||||
@@ -809,12 +809,12 @@ t#tf_nameorid {
|
|||||||
#tf_submitZahlToHandel {
|
#tf_submitZahlToHandel {
|
||||||
background-color: #008CBA;
|
background-color: #008CBA;
|
||||||
border: none;
|
border: none;
|
||||||
height: 1vw;
|
height: 1.4vw;
|
||||||
width: 7vw;
|
width: 7vw;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 0.4vw;
|
font-size: 0.6vw;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: -3vw;
|
left: -3vw;
|
||||||
top: 7vw;
|
top: 7vw;
|
||||||
@@ -830,15 +830,15 @@ t#tf_nameorid {
|
|||||||
#tf_submitZahlToVehicle {
|
#tf_submitZahlToVehicle {
|
||||||
background-color: #008CBA;
|
background-color: #008CBA;
|
||||||
border: none;
|
border: none;
|
||||||
height: 1vw;
|
height: 1.3vw;
|
||||||
width: 8vw;
|
width: 7.8vw;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 0.5vw;
|
font-size: 0.6vw;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 10.8vw;
|
left: 10.8vw;
|
||||||
top: 5.95vw;
|
top: 5.45vw;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
transition: 0.3s;
|
transition: 0.3s;
|
||||||
@@ -871,14 +871,14 @@ select.select_box2 {
|
|||||||
.blueIcon1 {
|
.blueIcon1 {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 3vw;
|
height: 3vw;
|
||||||
margin-bottom: -4vw;
|
margin-bottom: -3.1vw;
|
||||||
margin-left: 13.4vw;
|
margin-left: 13.4vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blueIcon2 {
|
.blueIcon2 {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 3vw;
|
height: 3vw;
|
||||||
margin-bottom: -3.1vw;
|
margin-bottom: 0.9vw;
|
||||||
margin-left: 3.4vw;
|
margin-left: 3.4vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -916,3 +916,56 @@ select.select_box2 {
|
|||||||
top: 3vw;
|
top: 3vw;
|
||||||
color: #ffffff;
|
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;
|
||||||
|
}
|
||||||
@@ -10,6 +10,10 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<div class="alerts" id='alertbox'>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<ul>
|
<ul>
|
||||||
@@ -112,6 +116,8 @@
|
|||||||
function getVehicle() {
|
function getVehicle() {
|
||||||
if (vehInv.length > 0) {
|
if (vehInv.length > 0) {
|
||||||
switchSite('vehClass');
|
switchSite('vehClass');
|
||||||
|
} else {
|
||||||
|
mp.trigger("Error", "Kofferraum leer oder kein Fahrzeug in der Nähe.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,7 +264,7 @@
|
|||||||
var redButton = document.createElement("div");
|
var redButton = document.createElement("div");
|
||||||
var redButtonImg = document.createElement("img");
|
var redButtonImg = document.createElement("img");
|
||||||
redButton.setAttribute("class", "red");
|
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("src", "img/backpack/trash.svg");
|
||||||
redButtonImg.setAttribute("class", "redImg");
|
redButtonImg.setAttribute("class", "redImg");
|
||||||
redButton.appendChild(redButtonImg);
|
redButton.appendChild(redButtonImg);
|
||||||
@@ -267,7 +273,7 @@
|
|||||||
var blueButton = document.createElement("div");
|
var blueButton = document.createElement("div");
|
||||||
var blueButtonImg = document.createElement("img");
|
var blueButtonImg = document.createElement("img");
|
||||||
blueButton.setAttribute("class", "blue2");
|
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("src", "img/backpack/paper-plane.svg");
|
||||||
blueButtonImg.setAttribute("class", "blueImg");
|
blueButtonImg.setAttribute("class", "blueImg");
|
||||||
blueButton.appendChild(blueButtonImg);
|
blueButton.appendChild(blueButtonImg);
|
||||||
@@ -381,26 +387,104 @@
|
|||||||
|
|
||||||
var clnc = 1;
|
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) {
|
function onAction(action, id, ammount, i) {
|
||||||
$(".Betrag").hide();
|
$(".Betrag").hide();
|
||||||
|
|
||||||
if (action == 0)//green
|
if (action == 0)//green
|
||||||
{
|
{
|
||||||
$(".Betrag").show();
|
mp.trigger("CEF:useItem", JSON.stringify("use"), JSON.stringify(0), JSON.stringify(id))
|
||||||
$("#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()
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (action == 1)//red
|
if (action == 1)//red
|
||||||
{
|
{
|
||||||
@@ -408,14 +492,10 @@
|
|||||||
$("#tf_submitZahl").unbind('click').click(function () {
|
$("#tf_submitZahl").unbind('click').click(function () {
|
||||||
|
|
||||||
if ($('#tf_zahl').val() < ammount && ammount > 0) {
|
if ($('#tf_zahl').val() < ammount && ammount > 0) {
|
||||||
rucksackInv[i].Amount -= $('#tf_zahl').val();
|
mp.trigger("CEF:useItem", JSON.stringify("drop"), JSON.stringify($('#tf_zahl').val()), JSON.stringify(rucksackInv[i].ID))
|
||||||
mp.trigger("CEF:throwItem", JSON.stringify("drop"), JSON.stringify($('#tf_zahl').val()), JSON.stringify(rucksackInv[i].ID))
|
|
||||||
} else if ($('#tf_zahl').val() >= ammount) {
|
} else if ($('#tf_zahl').val() >= ammount) {
|
||||||
mp.trigger("CEF:throwItem", JSON.stringify("drop"), JSON.stringify(ammount), JSON.stringify(rucksackInv[i].ID))
|
mp.trigger("CEF:useItem", JSON.stringify("drop"), JSON.stringify(ammount), JSON.stringify(rucksackInv[i].ID))
|
||||||
rucksackInv.splice(i, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(i);
|
|
||||||
$(".Betrag").hide();
|
$(".Betrag").hide();
|
||||||
drawRucksack();
|
drawRucksack();
|
||||||
drawVehicle();
|
drawVehicle();
|
||||||
@@ -479,7 +559,7 @@
|
|||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Origin[0] = 0;
|
||||||
var y = parseInt($('#tf_zahl2').val(), 10);
|
var y = parseInt($('#tf_zahl2').val(), 10);
|
||||||
if ($('#tf_zahl2').val() < ammount && ammount > 0) {
|
if ($('#tf_zahl2').val() < ammount && ammount > 0) {
|
||||||
|
|
||||||
@@ -555,7 +635,7 @@
|
|||||||
} else if ($('#tf_zahl3').val() >= ammount) {
|
} else if ($('#tf_zahl3').val() >= ammount) {
|
||||||
for (x = 0; x < rucksackInv.length; x++) {
|
for (x = 0; x < rucksackInv.length; x++) {
|
||||||
if (rucksackInv[x].ID == Copy.ID) {
|
if (rucksackInv[x].ID == Copy.ID) {
|
||||||
rucksackInv[x].Amount += y;
|
rucksackInv[x].Amount += ammount;
|
||||||
handelInv.splice(i, 1);
|
handelInv.splice(i, 1);
|
||||||
$(".Betrag3").hide();
|
$(".Betrag3").hide();
|
||||||
drawHandel();
|
drawHandel();
|
||||||
@@ -580,6 +660,7 @@
|
|||||||
$(".Betrag4").show();
|
$(".Betrag4").show();
|
||||||
var Copy = Object.assign({}, vehInv[i]);
|
var Copy = Object.assign({}, vehInv[i]);
|
||||||
$("#tf_submitZahl4").unbind('click').click(function () {
|
$("#tf_submitZahl4").unbind('click').click(function () {
|
||||||
|
Origin[0] = 1;
|
||||||
var y = parseInt($('#tf_zahl4').val(), 10);
|
var y = parseInt($('#tf_zahl4').val(), 10);
|
||||||
if ($('#tf_zahl4').val() < ammount && ammount > 0) {
|
if ($('#tf_zahl4').val() < ammount && ammount > 0) {
|
||||||
|
|
||||||
@@ -589,28 +670,29 @@
|
|||||||
vehInv[i].Amount -= y;
|
vehInv[i].Amount -= y;
|
||||||
$(".Betrag2").hide();
|
$(".Betrag2").hide();
|
||||||
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(vehInv[i].Amount), JSON.stringify(y));
|
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(vehInv[i].Amount), JSON.stringify(y));
|
||||||
drawVehicle();
|
|
||||||
drawRucksack();
|
drawRucksack();
|
||||||
|
drawVehicle();
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(rucksackInv);
|
||||||
rucksackInv.push(Copy);
|
rucksackInv.push(Copy);
|
||||||
rucksackInv[rucksackInv.length - 1].Amount = y;
|
rucksackInv[rucksackInv.length - 1].Amount = y;
|
||||||
rucksackInv[rucksackInv.length - 1].Category = 2;
|
rucksackInv[rucksackInv.length - 1].Category = 2;
|
||||||
vehInv[i].Amount -= y;
|
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) {
|
} else if ($('#tf_zahl4').val() >= ammount) {
|
||||||
for (x = 0; x < rucksackInv.length; x++) {
|
for (x = 0; x < rucksackInv.length; x++) {
|
||||||
if (rucksackInv[x].ID == Copy.ID) {
|
if (rucksackInv[x].ID == Copy.ID) {
|
||||||
rucksackInv[x].Amount += y;
|
rucksackInv[x].Amount += ammount;
|
||||||
vehInv.splice(i, 1);
|
vehInv.splice(i, 1);
|
||||||
$(".Betrag2").hide();
|
$(".Betrag2").hide();
|
||||||
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(0), JSON.stringify(ammount));
|
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(0), JSON.stringify(ammount));
|
||||||
drawVehicle();
|
|
||||||
drawRucksack();
|
drawRucksack();
|
||||||
|
drawVehicle();
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
return;
|
return;
|
||||||
@@ -618,13 +700,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
rucksackInv.push(Copy);
|
rucksackInv.push(Copy);
|
||||||
|
rucksackInv[rucksackInv.length - 1].Amount = ammount;
|
||||||
rucksackInv[rucksackInv.length - 1].Category = 2;
|
rucksackInv[rucksackInv.length - 1].Category = 2;
|
||||||
vehInv.splice(i, 1);
|
vehInv.splice(i, 1);
|
||||||
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(0), JSON.stringify(ammount));
|
mp.trigger("CEF:saveVehicleTransfer",1, JSON.stringify(Origin), JSON.stringify(Copy.ID), JSON.stringify(0), JSON.stringify(ammount));
|
||||||
}
|
}
|
||||||
$(".Betrag4").hide();
|
$(".Betrag4").hide();
|
||||||
drawVehicle();
|
|
||||||
drawRucksack();
|
drawRucksack();
|
||||||
|
drawVehicle();
|
||||||
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
});
|
});
|
||||||
@@ -793,7 +878,7 @@
|
|||||||
var redButton = document.createElement("div");
|
var redButton = document.createElement("div");
|
||||||
var redButtonImg = document.createElement("img");
|
var redButtonImg = document.createElement("img");
|
||||||
redButton.setAttribute("class", "red");
|
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("src", "img/backpack/trash.svg");
|
||||||
redButtonImg.setAttribute("class", "redImg");
|
redButtonImg.setAttribute("class", "redImg");
|
||||||
redButton.appendChild(redButtonImg);
|
redButton.appendChild(redButtonImg);
|
||||||
@@ -802,7 +887,7 @@
|
|||||||
var blueButton = document.createElement("div");
|
var blueButton = document.createElement("div");
|
||||||
var blueButtonImg = document.createElement("img");
|
var blueButtonImg = document.createElement("img");
|
||||||
blueButton.setAttribute("class", "blue2");
|
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("src", "img/backpack/paper-plane.svg");
|
||||||
blueButtonImg.setAttribute("class", "blueImg");
|
blueButtonImg.setAttribute("class", "blueImg");
|
||||||
blueButton.appendChild(blueButtonImg);
|
blueButton.appendChild(blueButtonImg);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ Infobox(globalData);
|
|||||||
//nametags();
|
//nametags();
|
||||||
|
|
||||||
import playerList from './Gui/playerlist';
|
import playerList from './Gui/playerlist';
|
||||||
playerList();
|
playerList(globalData);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -78,14 +78,45 @@ export default function inventory(globalData: GlobalData): void {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CEF:invThrowItem", (itemId, amount) => {
|
mp.events.add("CEF:useItem", (type, amount, id) => {
|
||||||
mp.events.callRemote('invThrowItem', itemId, amount);
|
|
||||||
});
|
|
||||||
|
|
||||||
mp.events.add("CEF:throwItem", (type, amount, id) => {
|
|
||||||
mp.events.callRemote("itemInteract", 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", () => {
|
mp.events.add("CEF:InventoryLoaded", () => {
|
||||||
if (offer == 1) {
|
if (offer == 1) {
|
||||||
invBrowser.execute(`changeTradeStatus('${JSON.stringify(offer)}')`);
|
invBrowser.execute(`changeTradeStatus('${JSON.stringify(offer)}')`);
|
||||||
@@ -101,6 +132,7 @@ export default function inventory(globalData: GlobalData): void {
|
|||||||
mp.events.callRemote('getNearVehicles');
|
mp.events.callRemote('getNearVehicles');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
mp.events.add("CEF:acceptTrade", () => {
|
mp.events.add("CEF:acceptTrade", () => {
|
||||||
if (invBrowser !== null) {
|
if (invBrowser !== null) {
|
||||||
mp.events.callRemote('acceptTrade');
|
mp.events.callRemote('acceptTrade');
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using ReallifeGamemode.Server.Managers;
|
|||||||
using ReallifeGamemode.Server.Util;
|
using ReallifeGamemode.Server.Util;
|
||||||
using ReallifeGamemode.Server.Wanted;
|
using ReallifeGamemode.Server.Wanted;
|
||||||
using ReallifeGamemode.Server.DrivingSchool;
|
using ReallifeGamemode.Server.DrivingSchool;
|
||||||
|
using ReallifeGamemode.Server.WeaponDeal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @overview Life of German Reallife - Main Class (Main.cs)
|
* @overview Life of German Reallife - Main Class (Main.cs)
|
||||||
@@ -77,6 +78,7 @@ namespace ReallifeGamemode.Server
|
|||||||
WantedEscapeTimer.WantedTimer();
|
WantedEscapeTimer.WantedTimer();
|
||||||
Jail.JailTimer();
|
Jail.JailTimer();
|
||||||
Economy.PaydayTimer();
|
Economy.PaydayTimer();
|
||||||
|
WeaponDealManager.WeaponDealTimer();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,6 +137,26 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
return inventoryWeight;
|
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)
|
public static UserItem UserHasThisItem(Client player, int itemId)
|
||||||
{
|
{
|
||||||
var user = player.GetUser();
|
var user = player.GetUser();
|
||||||
@@ -192,7 +212,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
if (veh.Position.DistanceTo(client.Position) < 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
|
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();
|
VehicleItem vehItem = context.VehicleItems.Where(v => v.VehicleId == origin[1] && v.ItemId == vItem.ItemId).FirstOrDefault();
|
||||||
if (vehItem != null)
|
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)
|
if (itemAmount < vehItem.Amount)
|
||||||
{
|
{
|
||||||
UserItem uItem = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == vItem.ItemId).FirstOrDefault();
|
UserItem uItem = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == vItem.ItemId).FirstOrDefault();
|
||||||
@@ -254,6 +293,24 @@ 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);
|
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)
|
if (iItem is IWeaponDealItem weaponDealItem)
|
||||||
{
|
{
|
||||||
@@ -313,7 +370,6 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
VehicleItem vItem = new VehicleItem
|
VehicleItem vItem = new VehicleItem
|
||||||
{
|
{
|
||||||
Amount = itemAmount,
|
Amount = itemAmount,
|
||||||
@@ -336,7 +392,8 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
vehItem.Amount = vItem.Amount;
|
vehItem.Amount = vItem.Amount;
|
||||||
}
|
}
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
IItem iItem = GetItemById(vItem.ItemId);
|
||||||
|
player.TriggerEvent("aproveTransfer", JsonConvert.DeserializeObject<int>(vehAmount), iItem.Name, "Rucksack");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,6 +405,7 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
var user = player.GetUser();
|
var user = player.GetUser();
|
||||||
var itemID = JsonConvert.DeserializeObject<int>(jsonItemID);
|
var itemID = JsonConvert.DeserializeObject<int>(jsonItemID);
|
||||||
var itemAmount = JsonConvert.DeserializeObject<int>(jsonItemAmount);
|
var itemAmount = JsonConvert.DeserializeObject<int>(jsonItemAmount);
|
||||||
|
var origin = JsonConvert.DeserializeObject<int[]>(jsonGotFrom);
|
||||||
|
|
||||||
if (!CheckOriginOfItem(player,jsonItemID, jsonItemAmount,jsonGotFrom, vehAmount))
|
if (!CheckOriginOfItem(player,jsonItemID, jsonItemAmount,jsonGotFrom, vehAmount))
|
||||||
return;
|
return;
|
||||||
@@ -362,6 +420,8 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
UserId = user.Id,
|
UserId = user.Id,
|
||||||
Slot = -1,
|
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)
|
if (item == null)
|
||||||
{
|
{
|
||||||
@@ -377,6 +437,8 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
}
|
}
|
||||||
|
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
IItem iItem = GetItemById(item.ItemId);
|
||||||
|
player.TriggerEvent("aproveTransfer", JsonConvert.DeserializeObject<int>(vehAmount), iItem.Name, "Kofferraum");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -503,37 +565,37 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case "use":
|
case "use":
|
||||||
ChatService.SendMessage(player, "use item: " + iItem.Name);
|
|
||||||
if (iItem == null)
|
if (iItem == null)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "Dieses Essen existiert nicht.");
|
player.TriggerEvent("Error", "Dieses Essen existiert nicht.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fItem == null)
|
if (fItem == null)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "Du hast dieses Item nicht");
|
player.TriggerEvent("Error", "Du hast dieses Item nicht");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iItem is IUsableItem usableItemObj)
|
if (iItem is IUsableItem usableItemObj)
|
||||||
{
|
{
|
||||||
usableItemObj.Use(fItem);
|
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;
|
break;
|
||||||
case "drop":
|
case "drop":
|
||||||
|
|
||||||
if (iItem == null)
|
if (iItem == null)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "Dieses Item existiert nicht.");
|
player.TriggerEvent("Error", "Dieses Item existiert nicht.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fItem == null)
|
if (fItem == null)
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(player, "Du hast dieses Item nicht");
|
player.TriggerEvent("Error", "Du hast dieses Item nicht");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,7 +625,8 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
{
|
{
|
||||||
context.UserItems.Remove(fItem);
|
context.UserItems.Remove(fItem);
|
||||||
}
|
}
|
||||||
|
player.TriggerEvent("removeItem", itemId, amount);
|
||||||
|
player.TriggerEvent("aproveThrow", amount, iItem.Name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
|||||||
ChatService.SendMessage(client, "Steige in den Burrito ein und fahre zum Waffendeal.");
|
ChatService.SendMessage(client, "Steige in den Burrito ein und fahre zum Waffendeal.");
|
||||||
fVeh.SetData("weaponDeal", true);
|
fVeh.SetData("weaponDeal", true);
|
||||||
WeaponDealPoints.factionWeaponDeal[user.FactionId.Value] = -1;
|
WeaponDealPoints.factionWeaponDeal[user.FactionId.Value] = -1;
|
||||||
user.Faction.WeaponDealTime = 60;
|
Faction fac = context.Factions.Where(f => f.Id == user.FactionId).FirstOrDefault();
|
||||||
|
fac.WeaponDealTime = 60;
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -52,6 +53,29 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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")]
|
[RemoteEvent("loadWeaponTransport")]
|
||||||
public void SrvEVENT_loadWeaponTransport(Client client)
|
public void SrvEVENT_loadWeaponTransport(Client client)
|
||||||
{
|
{
|
||||||
@@ -69,9 +93,9 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
|||||||
Random rnd = new Random();
|
Random rnd = new Random();
|
||||||
if(factionVehicle.FactionId == 8 || factionVehicle.FactionId == 7)
|
if(factionVehicle.FactionId == 8 || factionVehicle.FactionId == 7)
|
||||||
{
|
{
|
||||||
VehicleItem item = new VehicleItem() { ItemId = 11, VehicleId = factionVehicle.Id, Amount = rnd.Next(45, 100) }; //pistole
|
VehicleItem item = new VehicleItem() { ItemId = 11, VehicleId = factionVehicle.Id, Amount = rnd.Next(45, 75) }; //pistole
|
||||||
InventoryManager.AddItemToVehicleInventory(client, item, fVeh);
|
InventoryManager.AddItemToVehicleInventory(client, item, fVeh);
|
||||||
VehicleItem item3 = new VehicleItem() { ItemId = 14, VehicleId = factionVehicle.Id, Amount = rnd.Next(30, 50) }; //Pumpe
|
VehicleItem item3 = new VehicleItem() { ItemId = 14, VehicleId = factionVehicle.Id, Amount = rnd.Next(30, 40) }; //Pumpe
|
||||||
InventoryManager.AddItemToVehicleInventory(client, item3, fVeh);
|
InventoryManager.AddItemToVehicleInventory(client, item3, fVeh);
|
||||||
VehicleItem item2 = new VehicleItem() { ItemId = 16, VehicleId = factionVehicle.Id, Amount = rnd.Next(5, 15) }; //Schutzweste
|
VehicleItem item2 = new VehicleItem() { ItemId = 16, VehicleId = factionVehicle.Id, Amount = rnd.Next(5, 15) }; //Schutzweste
|
||||||
InventoryManager.AddItemToVehicleInventory(client, item2, fVeh);
|
InventoryManager.AddItemToVehicleInventory(client, item2, fVeh);
|
||||||
|
|||||||
@@ -14,10 +14,13 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
|||||||
|
|
||||||
private static readonly IReadOnlyCollection<Vector3> WT_Route = new List<Vector3>
|
private static readonly IReadOnlyCollection<Vector3> WT_Route = new List<Vector3>
|
||||||
{
|
{
|
||||||
new Vector3(2465.163, 1589.396, 32.72029),
|
//new Vector3(2465.163, 1589.396, 32.72029), ungeeignet
|
||||||
new Vector3(1532.045, 1702.775, 109.7561),
|
new Vector3(1532.045, 1702.775, 109.7561), //Hütte iwo Östlich
|
||||||
new Vector3(58.67861, 3717.103, 39.75301),
|
new Vector3(58.67861, 3717.103, 39.75301), //Lost MC
|
||||||
new Vector3(-2174.734, 4269.301, 48.95574)
|
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();
|
}.AsReadOnly();
|
||||||
|
|
||||||
public static Vector3 getRndWD_Route(int factionID)
|
public static Vector3 getRndWD_Route(int factionID)
|
||||||
|
|||||||
Reference in New Issue
Block a user