Added waypoint to vehicle when buying

This commit is contained in:
hydrant
2019-03-10 15:10:40 +01:00
parent 491d4a51bb
commit f6fac52b3d
6 changed files with 9 additions and 89 deletions

View File

@@ -1,40 +0,0 @@
<!--
* @overview Life of German Reallife - Client Gui playerlist.html
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*-->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css" />
<script src="playerlist.js"></script>
</head>
<body>
<div class="playerlist">
<div id="testDiv"></div>
<table>
<thead>
<tr>
<th><center>ID</center></th>
<th>Name</th>
<th><center>Ping</center></th>
</tr>
</thead>
<tbody id="playerData"></tbody>
</table>
</div>
<script src="jquery-3.3.1.min.js"></script>
<script>
$(document).ready(function () {
//var table;
for (var player in pList) {
$("#playerData").append("<tr><td>" + player.Id + "</td><td>" + player.Name + "</td><td>" + player.Ping + "</td></tr>");
//table =+ tableRow;
}
//document.getElementById("testDiv").innerHTML = table;
});
</script>
</body>
</html>

View File

@@ -1,8 +0,0 @@
$(document).ready(function () {
mp.trig
for (var player in pList) {
$("#playerData").append("<tr><td>" + player.Id + "</td><td>" + player.Name + "</td><td>" + player.Ping + "</td></tr>");
}
});

View File

@@ -1,38 +0,0 @@
/**
* @overview Life of German Reallife - Save CSS style.css
* @author Orangebox, hydrant, VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
.playerlist {
background-color: rgba(61, 68, 87, 0.50);
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
min-width: 60%;
text-align: center;
}
body {
font-family: "Roboto", sans-serif;
-webkit-font-smoothing: antialiased;
overflow: hidden;
}
td {
align-content: stretch;
padding-left: 10px;
padding-right: 10px;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 0, 0, 0.24);
border-top: 2px double gray;
border-bottom: 2px double gray;
border-width: 0.5px;
width: auto;
}
table {
margin: auto;
align-self:center;
width: 100%;
}

View File

@@ -52,6 +52,8 @@ require('./Tuning/main.js');
require('./Tuning/sync.js');
require('./Tuning/sirensilence.js');
require('./util/waypoint.js');
require('./vehiclesync/vehiclesync.js');
require('./vehiclesync/smoothtrottle.js');
require('./vehiclesync/vehicleindicators.js');

View File

@@ -0,0 +1,3 @@
mp.events.add("SERVER:Util_setWaypoint", (x, y) => {
mp.game.ui.setNewWaypoint(x, y);
});

View File

@@ -127,7 +127,7 @@ namespace ReallifeGamemode.Server.Managers
if (!(sVeh is ShopVehicle)) return;
ShopVehicle shopVehicle = (ShopVehicle)sVeh;
int price = shopVehicle.Price;
CarDealerBusinessBase business = (CarDealerBusinessBase)GetBusiness(shopVehicle.BusinessId);
CarDealerBusinessBase business = GetBusiness(shopVehicle.BusinessId) as CarDealerBusinessBase;
TransactionResult result = BankManager.TransferMoney(player.GetUser(), business, price, "Auto gekauft");
if(result == TransactionResult.SENDER_NOT_ENOUGH_MONEY)
{
@@ -135,7 +135,9 @@ namespace ReallifeGamemode.Server.Managers
return;
}
Vector3 spawnPos = business.CarSpawnPositon;
Vector3 spawnPos = business.CarSpawnPositon.Around(3);
player.TriggerEvent("SERVER:Util_setWaypoint", spawnPos.X, spawnPos.Y);
UserVehicle newVeh = new UserVehicle
{
@@ -149,7 +151,6 @@ namespace ReallifeGamemode.Server.Managers
PrimaryColor = 111,
SecondaryColor = 111,
Active = true,
NumberPlate = ""
};
using(var dbContext = new DatabaseContext())