Merge branch 'develop' into 'luke-develop-patch-56806'
# Conflicts: # ReallifeGamemode.Server/Job/RefuseCollectorJob.cs
This commit is contained in:
@@ -8,6 +8,11 @@ let lastPrice: Number = 0;
|
|||||||
let totalPrice: Number = 0;
|
let totalPrice: Number = 0;
|
||||||
var myVar;
|
var myVar;
|
||||||
export default function taximeterInput(globalData: IGlobalData) {
|
export default function taximeterInput(globalData: IGlobalData) {
|
||||||
|
var customerBrowser: boolean = false;
|
||||||
|
|
||||||
|
var price1_browser = 0;
|
||||||
|
var km_browser = 0;
|
||||||
|
|
||||||
mp.events.add("CLIENT:setFarePrice", () => {
|
mp.events.add("CLIENT:setFarePrice", () => {
|
||||||
/*
|
/*
|
||||||
var textBox = new InputHelper("Setzen Sie ihre Fahrtkosten [2 - 50 $/km]", globalData);
|
var textBox = new InputHelper("Setzen Sie ihre Fahrtkosten [2 - 50 $/km]", globalData);
|
||||||
@@ -29,15 +34,14 @@ export default function taximeterInput(globalData: IGlobalData) {
|
|||||||
|
|
||||||
mp.events.add("CLIENT:startFare", () => {
|
mp.events.add("CLIENT:startFare", () => {
|
||||||
browser = mp.browsers.new('package://assets/html/taximeter/index.html');
|
browser = mp.browsers.new('package://assets/html/taximeter/index.html');
|
||||||
browser.execute(`setFarePrice('${price}');`)
|
|
||||||
myVar = setInterval(myTimer, 100);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add('CLIENT:stopFare', () => {
|
mp.events.add('CLIENT:stopFare', () => {
|
||||||
browser.destroy()
|
if (browser) {
|
||||||
browser = null;
|
browser.destroy();
|
||||||
|
browser = null;
|
||||||
|
}
|
||||||
globalData.InInput = false;
|
globalData.InInput = false;
|
||||||
return;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function myTimer() {
|
function myTimer() {
|
||||||
@@ -53,33 +57,50 @@ export default function taximeterInput(globalData: IGlobalData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
mp.events.add("CLIENT:startCustomerFare", (price1, km) => {
|
mp.events.add("CEF:Taxi_CefLoaded", () => {
|
||||||
browser = mp.browsers.new('package://assets/html/taximeter/index.html');
|
if (!customerBrowser) {
|
||||||
browser.execute(`setFarePrice('${price1}');`);
|
browser.execute(`setFarePrice('${price}');`)
|
||||||
browser.execute(`updateKilometer('${km}')`);
|
myVar = setInterval(myTimer, 100);
|
||||||
|
} else {
|
||||||
|
browser.execute(`setFarePrice('${price1_browser}');`);
|
||||||
|
browser.execute(`updateKilometer('${km_browser}')`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mp.events.add("CLIENT:startCustomerFare", (price1, km) => {
|
||||||
|
price1_browser = price1;
|
||||||
|
km_browser = km;
|
||||||
|
|
||||||
|
browser = mp.browsers.new('package://assets/html/taximeter/index.html');
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CLIENT:updateFare", (km) => {
|
mp.events.add("CLIENT:updateFare", (km) => {
|
||||||
browser.execute(`updateKilometer('${JSON.parse(km)}')`)
|
if (browser) {
|
||||||
|
browser.execute(`updateKilometer('${JSON.parse(km)}')`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
mp.events.add("CLIENT:cancelFareCustomer", () => { //for Customer
|
mp.events.add("CLIENT:cancelFareCustomer", () => { //for Customer
|
||||||
|
if (browser) {
|
||||||
|
browser.destroy();
|
||||||
|
browser = null;
|
||||||
|
}
|
||||||
|
|
||||||
mp.events.callRemote("SERVER:cancelFareCustomer", lastPrice);
|
mp.events.callRemote("SERVER:cancelFareCustomer", lastPrice);
|
||||||
browser.destroy();
|
|
||||||
browser = null;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CLIENT:cancelFare", () => { //for Taxidriver
|
mp.events.add("CLIENT:cancelFare", () => { //for Taxidriver
|
||||||
browser.destroy();
|
if (browser) {
|
||||||
browser = null;
|
browser.destroy();
|
||||||
|
browser = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("CLIENT:resetFareClock", () => { //for Taxidriver
|
mp.events.add("CLIENT:resetFareClock", () => { //for Taxidriver
|
||||||
clearInterval(myVar);
|
if (browser) {
|
||||||
browser.execute(`setFarePrice('${price}');`)
|
clearInterval(myVar);
|
||||||
|
browser.execute(`setFarePrice('${price}');`)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,7 @@ export default function (globalData: IGlobalData) {
|
|||||||
|
|
||||||
taxiCallsMenu.ItemSelect.on((item: NativeUI.UIMenuItem, index: number) => {
|
taxiCallsMenu.ItemSelect.on((item: NativeUI.UIMenuItem, index: number) => {
|
||||||
mp.events.callRemote("CLIENT:JobManager_TaxiJob_AcceptCall", item.Text);
|
mp.events.callRemote("CLIENT:JobManager_TaxiJob_AcceptCall", item.Text);
|
||||||
menu.Close();
|
menu.Close(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (status === 1) { // Spieler hat aktiven Auftrag
|
} else if (status === 1) { // Spieler hat aktiven Auftrag
|
||||||
@@ -55,7 +55,7 @@ export default function (globalData: IGlobalData) {
|
|||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
menu.Close();
|
menu.Close(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
menu.MenuClose.on(() => {
|
menu.MenuClose.on(() => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de" >
|
<html lang="de" >
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<head>
|
<head>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<div class="bg-box4">Kontostand</div>
|
<div class="bg-box4">Kontostand</div>
|
||||||
<div class="bg-box5">Informationen</div>
|
<div class="bg-box5">Informationen</div>
|
||||||
<div class="bg-box6">Verlauf</div>
|
<div class="bg-box6">Verlauf</div>
|
||||||
<div class="bg-box7">Karte Auswerfen</div>
|
<div class="bg-box7">Karte auswerfen</div>
|
||||||
<div class="bg-box8"></div>
|
<div class="bg-box8"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
var lastKilometer = 0;
|
var lastKilometer = 0;
|
||||||
var price;
|
var price;
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () { });
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
mp.trigger('CEF:Taxi_CefLoaded');
|
||||||
|
});
|
||||||
|
|
||||||
const TOTAL_PRICE = document.getElementById("taximeter-price");
|
const TOTAL_PRICE = document.getElementById("taximeter-price");
|
||||||
const PRICE_KM = document.getElementById("taximeter-price-kilometer");
|
const PRICE_KM = document.getElementById("taximeter-price-kilometer");
|
||||||
|
|||||||
1859
ReallifeGamemode.Database/Migrations/20200802143111_AddUserOtherAmount.Designer.cs
generated
Normal file
1859
ReallifeGamemode.Database/Migrations/20200802143111_AddUserOtherAmount.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddUserOtherAmount : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "otheramount",
|
||||||
|
table: "Users",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "trashcount",
|
||||||
|
table: "Users",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "GangOwned",
|
||||||
|
table: "Factions",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "otheramount",
|
||||||
|
table: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "trashcount",
|
||||||
|
table: "Users");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "GangOwned",
|
||||||
|
table: "Factions");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -469,6 +469,9 @@ namespace ReallifeGamemode.Database.Migrations
|
|||||||
b.Property<int?>("BankAccountId")
|
b.Property<int?>("BankAccountId")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<bool>("GangOwned")
|
||||||
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("varchar(32) CHARACTER SET utf8mb4")
|
.HasColumnType("varchar(32) CHARACTER SET utf8mb4")
|
||||||
.HasMaxLength(32);
|
.HasMaxLength(32);
|
||||||
@@ -1017,7 +1020,8 @@ namespace ReallifeGamemode.Database.Migrations
|
|||||||
b.Property<float>("PositionZ")
|
b.Property<float>("PositionZ")
|
||||||
.HasColumnType("float");
|
.HasColumnType("float");
|
||||||
|
|
||||||
b.Property<int>("Type");
|
b.Property<int>("Type")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
@@ -1411,6 +1415,12 @@ namespace ReallifeGamemode.Database.Migrations
|
|||||||
b.Property<bool>("WeaponLicense")
|
b.Property<bool>("WeaponLicense")
|
||||||
.HasColumnType("tinyint(1)");
|
.HasColumnType("tinyint(1)");
|
||||||
|
|
||||||
|
b.Property<int>("otheramount")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<int>("trashcount")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("BanId");
|
b.HasIndex("BanId");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
@@ -35,7 +35,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
|
|
||||||
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
||||||
|
|
||||||
string broadcastMessage = "!{02FCFF}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " )) **";
|
string broadcastMessage = "!{02FCFF}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " **";
|
||||||
ChatService.BroadcastFaction(broadcastMessage, f);
|
ChatService.BroadcastFaction(broadcastMessage, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
{
|
{
|
||||||
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", "");
|
||||||
|
|
||||||
string broadcastMessage = "!{FF0000}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " )) **";
|
string broadcastMessage = "!{FF0000}** " + player.GetUser().GetFactionRank().RankName + " " + player.Name + ": " + message + " **";
|
||||||
using (var context = new DatabaseContext())
|
using (var context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned));
|
ChatService.BroadcastFaction(broadcastMessage, context.Factions.ToList().FindAll(c => c.GangOwned));
|
||||||
|
|||||||
@@ -199,6 +199,11 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
[RemoteEvent("CLIENT:MuellmannImShape")]
|
[RemoteEvent("CLIENT:MuellmannImShape")]
|
||||||
public void MuellmannImShape(Player player, int colshapeIndex)
|
public void MuellmannImShape(Player player, int colshapeIndex)
|
||||||
{
|
{
|
||||||
|
if (player.IsInVehicle)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var data in muellmanData)
|
foreach (var data in muellmanData)
|
||||||
{
|
{
|
||||||
if (data.getDataFromClient(player) == null) continue;
|
if (data.getDataFromClient(player) == null) continue;
|
||||||
@@ -212,7 +217,12 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
|
|
||||||
[RemoteEvent("CLIENT:MuellmannAddSack")]
|
[RemoteEvent("CLIENT:MuellmannAddSack")]
|
||||||
public void MuellmannAddSack(Player player)
|
public void MuellmannAddSack(Player player)
|
||||||
{
|
{
|
||||||
|
if (player.IsInVehicle)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var data in muellmanData)
|
foreach (var data in muellmanData)
|
||||||
{
|
{
|
||||||
if (data.getDataFromClient(player) == null) continue;
|
if (data.getDataFromClient(player) == null) continue;
|
||||||
@@ -244,17 +254,38 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
user1 = player.GetUser(dbContext);
|
||||||
|
user2 = target.GetUser(dbContext);
|
||||||
|
user1.trashcount += 1;
|
||||||
|
player.SendNotification("Müllsack: " + user1.trashcount + " von 20.");
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
player.GetUser().Wage += 10;
|
target.SendNotification("Müllsack: " + user2.trashcount + " von 20.");
|
||||||
target.GetUser().Wage += 10;
|
user2.trashcount += 1;
|
||||||
|
}
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
}
|
||||||
|
player.AddAttachment("binbag", true);
|
||||||
|
if (target != null)
|
||||||
|
if (player.GetUser().trashcount >= 20)
|
||||||
|
{
|
||||||
|
ChatService.SendMessage((Player)player, "Auto ist voll fahre nun zu Base.");
|
||||||
|
if (target != null) { ChatService.SendMessage((Player)target, "Auto ist voll fahre nun zu Base."); target.TriggerEvent("SERVER:MuellmannZuBase"); }
|
||||||
|
player.TriggerEvent("SERVER:MuellmannZuBase");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.GetUser().Wage += 20;
|
if (target != null)
|
||||||
|
{
|
||||||
|
player.GetUser().Wage += 10;
|
||||||
|
target.GetUser().Wage += 10;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.GetUser().Wage += 20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -281,18 +312,18 @@ namespace ReallifeGamemode.Server.Job
|
|||||||
{
|
{
|
||||||
player.GetUser().Wage += 200;
|
player.GetUser().Wage += 200;
|
||||||
}
|
}
|
||||||
User user1 = player.GetUser();
|
User user1 = player.GetUser();
|
||||||
User user2 = target.GetUser();
|
User user2 = target.GetUser();
|
||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
{
|
{
|
||||||
user1 = player.GetUser(dbContext);
|
user1 = player.GetUser(dbContext);
|
||||||
user2 = target.GetUser(dbContext);
|
user2 = target.GetUser(dbContext);
|
||||||
|
|
||||||
user1.trashcount -= user1.trashcount;
|
user1.trashcount -= user1.trashcount;
|
||||||
if (target != null)
|
if (target != null)
|
||||||
user2.trashcount -= user2.trashcount;
|
user2.trashcount -= user2.trashcount;
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
Console.WriteLine($"[DATA DEBUG] vehicle: {data.vehicle.DisplayName} | Players: {data.getClientsFromData().Count} | Säcke: {data.getTrashCount()}");
|
Console.WriteLine($"[DATA DEBUG] vehicle: {data.vehicle.DisplayName} | Players: {data.getClientsFromData().Count} | Säcke: {data.getTrashCount()}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user