Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop
This commit is contained in:
@@ -4,4 +4,8 @@
|
|||||||
mp.events.add("SERVER:SetWanteds", (count: number) => {
|
mp.events.add("SERVER:SetWanteds", (count: number) => {
|
||||||
browser.execute(`setWanteds(${count});`);
|
browser.execute(`setWanteds(${count});`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mp.events.add("SERVER:SetWantedFlash", (flash) => {
|
||||||
|
browser.execute(`setFlashing(${flash});`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,8 @@
|
|||||||
-2084633992,
|
-2084633992,
|
||||||
-1075685676,
|
-1075685676,
|
||||||
-1786099057,
|
-1786099057,
|
||||||
-1074790547
|
-1074790547,
|
||||||
|
-1569615261
|
||||||
]
|
]
|
||||||
|
|
||||||
mp.events.add("playerJoin", () => {
|
mp.events.add("playerJoin", () => {
|
||||||
@@ -152,7 +153,6 @@
|
|||||||
checkWeaponhash() {
|
checkWeaponhash() {
|
||||||
let h = this.weapon;
|
let h = this.weapon;
|
||||||
if (allowedWeaponHashes.indexOf(h) === -1) {
|
if (allowedWeaponHashes.indexOf(h) === -1) {
|
||||||
mp.gui.chat.push("unallowed weapon: " + h);
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@@ -189,12 +189,12 @@
|
|||||||
let Difference = Behaviour.subtractVector(Behaviour.pos, mp.players.local.position)
|
let Difference = Behaviour.subtractVector(Behaviour.pos, mp.players.local.position)
|
||||||
if (Math.abs(Difference.x) > 30 || Math.abs(Difference.y) > 30) {
|
if (Math.abs(Difference.x) > 30 || Math.abs(Difference.y) > 30) {
|
||||||
if (Behaviour.isWalking()) {
|
if (Behaviour.isWalking()) {
|
||||||
mp.events.callRemote("CLIENT:CheatDetection", "Flyhack/Teleport")
|
//mp.events.callRemote("CLIENT:CheatDetection", "Flyhack/Teleport")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mp.players.local.vehicle) {
|
if (mp.players.local.vehicle) {
|
||||||
if (Behaviour.checkCarPos(25)) {
|
if (Behaviour.checkCarPos(25)) {
|
||||||
mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Flyhack")
|
//mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Flyhack")
|
||||||
}
|
}
|
||||||
if (Behaviour.VehicleFasterThan(250)) {
|
if (Behaviour.VehicleFasterThan(250)) {
|
||||||
mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Speedhack")
|
mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Speedhack")
|
||||||
|
|||||||
@@ -1,60 +1,99 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||||
<title>Wanteds</title>
|
<title>Wanteds</title>
|
||||||
|
|
||||||
<style>
|
|
||||||
@font-face { font-family: 'Pricedown'; src: url('package://assets/font/Pricedown.ttf'); }
|
|
||||||
html, body { margin: 0; padding: 0; }
|
|
||||||
|
|
||||||
#wanteds {
|
<style>
|
||||||
position: absolute;
|
@font-face {
|
||||||
display: flex;
|
font-family: 'Pricedown';
|
||||||
justify-content: flex-end;
|
src: url('package://assets/font/Pricedown.ttf');
|
||||||
align-items: center;
|
}
|
||||||
top: 65px;
|
|
||||||
right: 22px;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wanteds img {
|
html, body {
|
||||||
width: 25px;
|
margin: 0;
|
||||||
height: 25px;
|
padding: 0;
|
||||||
margin-right: 5px;
|
}
|
||||||
|
|
||||||
filter: drop-shadow(0px 0px 1px #000000);
|
#wanteds {
|
||||||
-webkit-filter: drop-shadow(0px 0px 1px #000000);
|
position: absolute;
|
||||||
-moz-filter: drop-shadow(0px 0px 1px #000000);
|
display: flex;
|
||||||
}
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
top: 65px;
|
||||||
|
right: 22px;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
#wanteds span {
|
#wanteds img {
|
||||||
color: white;
|
width: 25px;
|
||||||
font-family: "Pricedown", sans-serif;
|
height: 25px;
|
||||||
font-size: 2.5em;
|
margin-right: 5px;
|
||||||
line-height: 1;
|
filter: drop-shadow(0px 0px 1px #000000);
|
||||||
-webkit-text-stroke: 1px black;
|
-webkit-filter: drop-shadow(0px 0px 1px #000000);
|
||||||
margin-top: -5px;
|
-moz-filter: drop-shadow(0px 0px 1px #000000);
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
#wanteds span {
|
||||||
|
color: white;
|
||||||
|
font-family: "Pricedown", sans-serif;
|
||||||
|
font-size: 2.5em;
|
||||||
|
line-height: 1;
|
||||||
|
-webkit-text-stroke: 1px black;
|
||||||
|
margin-top: -5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="wanteds" style="display: none;">
|
<div id="wanteds" style="display: none;">
|
||||||
<img src="package://assets/img/wanteds/star.svg"> <span id="wanted-count">10</span>
|
<img src="package://assets/img/wanteds/star.svg" id="wanted-star"> <span id="wanted-count">10</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="package://assets/js/jquery-3.3.1.min.js"></script>
|
<script src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function setWanteds(count) {
|
function setWanteds(count) {
|
||||||
if (count === 0) {
|
if (count === 0) {
|
||||||
$("#wanteds").hide();
|
$("#wanteds").hide();
|
||||||
} else {
|
} else {
|
||||||
$("#wanteds").show();
|
$("#wanteds").show();
|
||||||
$("#wanted-count").text(count.toString());
|
$("#wanted-count").text(count.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
var flashInterval = null;
|
||||||
|
|
||||||
|
var previousFlashToggle = false;
|
||||||
|
var firstToggle = true;
|
||||||
|
|
||||||
|
function setFlashing(flash) {
|
||||||
|
if (previousFlashToggle == flash && !firstToggle) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
firstToggle = false;
|
||||||
|
previousFlashToggle = flash;
|
||||||
|
if (flash) {
|
||||||
|
if (flashInterval) {
|
||||||
|
clearInterval(flashInterval);
|
||||||
|
}
|
||||||
|
flashInterval = setInterval(flashWantedImage, 750);
|
||||||
|
} else {
|
||||||
|
clearInterval(flashInterval);
|
||||||
|
$("#wanted-star").css('visibility', 'visible');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var flashStatus = false;
|
||||||
|
|
||||||
|
function flashWantedImage() {
|
||||||
|
flashStatus = !flashStatus;
|
||||||
|
if (flashStatus) {
|
||||||
|
$("#wanted-star").css('visibility', 'visible');
|
||||||
|
} else {
|
||||||
|
$("#wanted-star").css('visibility', 'hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -26,7 +26,7 @@ namespace ReallifeGamemode.Server.Admin
|
|||||||
{
|
{
|
||||||
if (!cheater.IsLoggedIn())
|
if (!cheater.IsLoggedIn())
|
||||||
{
|
{
|
||||||
cheater.Kick();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cheater.IsAdminDuty())
|
if(cheater.IsAdminDuty())
|
||||||
|
|||||||
@@ -841,13 +841,13 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
if (userwarn.warn >= 3)
|
if (userwarn.warn >= 3)
|
||||||
{
|
{
|
||||||
ChatService.Broadcast("~y~INFO: Das war der 3. Warn - bitte bannen!");
|
ChatService.BroadcastAdmin("~y~INFO: Das war der 3. Warn - bitte bannen!", AdminLevel.ADMIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatService.SendMessage(target, "~r~WARNINFO: ~w~Du wurdest von " + adminPlayername + " verwarnt: " + reason);
|
ChatService.SendMessage(target, "~r~WARNINFO: ~w~Du wurdest von " + adminPlayername + " verwarnt: " + reason);
|
||||||
|
|
||||||
ChatService.Broadcast("~y~INFO: ~w~" + targetPlayername + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " verwarnt: " + reason);
|
ChatService.BroadcastAdmin("~y~INFO: ~w~" + targetPlayername + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " verwarnt: " + reason, AdminLevel.ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("ip", "~m~Benutzung: ~s~/ip [Spieler]")]
|
[Command("ip", "~m~Benutzung: ~s~/ip [Spieler]")]
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
//player.SetSharedData("vehicleAdminSpeed2", 1.0);
|
//player.SetSharedData("vehicleAdminSpeed2", 1.0);
|
||||||
player.SetData("isLoggedIn", false);
|
player.SetData("isLoggedIn", false);
|
||||||
player.SafeTeleport(new Vector3(-1883.736, -781.4911, -10));
|
player.SafeTeleport(new Vector3(-1883.736, -781.4911, -10));
|
||||||
|
player.Dimension = (uint)(player.Handle.Value + 1);
|
||||||
|
|
||||||
bool registered = false;
|
bool registered = false;
|
||||||
|
|
||||||
|
|||||||
@@ -238,8 +238,12 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
player.RemoveAllWeapons();
|
player.RemoveAllWeapons();
|
||||||
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == player.Name);
|
MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == player.Name);
|
||||||
Player medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
|
||||||
Medic.RemoveTaskFromList(task);
|
if(task != null)
|
||||||
|
{
|
||||||
|
Player medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName);
|
||||||
|
Medic.RemoveTaskFromList(task);
|
||||||
|
}
|
||||||
|
|
||||||
player.SafeTeleport(new Vector3(-495.45, -336.33, 34.5), 0, true);
|
player.SafeTeleport(new Vector3(-495.45, -336.33, 34.5), 0, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
public void OnPlayerDisconnected(Player player, DisconnectionType type, string reason)
|
public void OnPlayerDisconnected(Player player, DisconnectionType type, string reason)
|
||||||
{
|
{
|
||||||
if (!player.IsLoggedIn()) return;
|
if (!player.IsLoggedIn()) return;
|
||||||
|
using var saveUser = new DatabaseContext();
|
||||||
|
User user = player.GetUser(saveUser);
|
||||||
|
|
||||||
|
if(user == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (type == DisconnectionType.Left)
|
if (type == DisconnectionType.Left)
|
||||||
{
|
{
|
||||||
@@ -49,7 +56,7 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
GlobalHelper.DutyAdmins.Remove(player);
|
GlobalHelper.DutyAdmins.Remove(player);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (player.GetUser().IsAdmin(AdminLevel.MAPPING))
|
if (user.IsAdmin(AdminLevel.MAPPING))
|
||||||
{
|
{
|
||||||
ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING);
|
ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING);
|
||||||
}
|
}
|
||||||
@@ -74,8 +81,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
{
|
{
|
||||||
Report.Report.listReports.Remove(temp);
|
Report.Report.listReports.Remove(temp);
|
||||||
|
|
||||||
Player user = PlayerService.GetPlayerByNameOrId(temp.getUser());
|
Player ticketUser = PlayerService.GetPlayerByNameOrId(temp.getUser());
|
||||||
user.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der Admin hat den Server verlassen");
|
ticketUser.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der Admin hat den Server verlassen");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,27 +131,23 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var saveUser = new DatabaseContext())
|
Vector3 pos = player.Position;
|
||||||
|
|
||||||
|
user.PositionX = pos.X;
|
||||||
|
user.PositionY = pos.Y;
|
||||||
|
user.PositionZ = pos.Z;
|
||||||
|
saveUser.SaveChanges();
|
||||||
|
user.Dead = player.HasData("isDead") ? (bool)player.GetData<bool>("isDead") : false;
|
||||||
|
|
||||||
|
if (user.Wanteds > 0)
|
||||||
{
|
{
|
||||||
var user = player.GetUser(saveUser);
|
ChatService.HQMessage("Der Straftäter " + user.Name + " ist vom Radar verschwunden");
|
||||||
Vector3 pos = player.Position;
|
|
||||||
|
|
||||||
user.PositionX = pos.X;
|
|
||||||
user.PositionY = pos.Y;
|
|
||||||
user.PositionZ = pos.Z;
|
|
||||||
saveUser.SaveChanges();
|
|
||||||
user.Dead = player.HasData("isDead") ? (bool)player.GetData<bool>("isDead") : false;
|
|
||||||
|
|
||||||
if (user.Wanteds > 0)
|
|
||||||
{
|
|
||||||
ChatService.HQMessage("Der Straftäter " + player.GetUser().Name + " ist vom Radar verschwunden");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
player.SetData("isLoggedIn", false);
|
player.SetData("isLoggedIn", false);
|
||||||
player.TriggerEvent("CLIENT:DestroyPed", 1);
|
player.TriggerEvent("CLIENT:DestroyPed", 1);
|
||||||
player.TriggerEvent("CLIENT:DestroyPed", 2);
|
player.TriggerEvent("CLIENT:DestroyPed", 2);
|
||||||
player.TriggerEvent("CLIENT:DestroyPed", 3);
|
player.TriggerEvent("CLIENT:DestroyPed", 3);
|
||||||
player.TriggerEvent("CLIENT:DestroyPed", 4);
|
player.TriggerEvent("CLIENT:DestroyPed", 4);
|
||||||
|
|
||||||
Medic.delHealTask(player);
|
Medic.delHealTask(player);
|
||||||
|
|||||||
@@ -144,6 +144,8 @@ namespace ReallifeGamemode.Server.Events
|
|||||||
{
|
{
|
||||||
Jail.Check_PutBehindBars(user);
|
Jail.Check_PutBehindBars(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.Dimension = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.TriggerEvent("draw", player.Name, player.Handle.Value);
|
player.TriggerEvent("draw", player.Name, player.Handle.Value);
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static User GetUser(this Player client, DatabaseContext context = null)
|
public static User GetUser(this Player client, DatabaseContext context = null)
|
||||||
{
|
{
|
||||||
context = context ?? new DatabaseContext();
|
|
||||||
if (!client.IsLoggedIn()) return null;
|
if (!client.IsLoggedIn()) return null;
|
||||||
|
|
||||||
|
context = context ?? new DatabaseContext();
|
||||||
return context
|
return context
|
||||||
.Users
|
.Users
|
||||||
.Include(u => u.Faction)
|
.Include(u => u.Faction)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
//ChatService.BroadcastAdmin("Eingehendes Ticket von " + client.Name + ": " + message + " (Benutze /showtickets)", AdminLevel.ADMIN);
|
//ChatService.BroadcastAdmin("Eingehendes Ticket von " + client.Name + ": " + message + " (Benutze /showtickets)", AdminLevel.ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("showtickets", "~m~Benutzung: ~s~/showtickets")]
|
[Command("showtickets", "~m~Benutzung: ~s~/showtickets", Alias = "st")]
|
||||||
public void CmdAdminShowtickets(Player client)
|
public void CmdAdminShowtickets(Player client)
|
||||||
{
|
{
|
||||||
if (!client.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
if (!client.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||||
|
|||||||
@@ -27,12 +27,8 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static void ResetWantedTimeToElapse(Player client)
|
public static void ResetWantedTimeToElapse(User user)
|
||||||
{
|
{
|
||||||
User user = client.GetUser();
|
|
||||||
if (user.FactionId == 1 || user.FactionId == 3)
|
|
||||||
return;
|
|
||||||
|
|
||||||
waTimer[user.Id] = WantedEscapeTime;
|
waTimer[user.Id] = WantedEscapeTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +41,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
if (user != null && user.Wanteds > 0)
|
if (user != null && user.Wanteds > 0)
|
||||||
{
|
{
|
||||||
if (!waTimer.ContainsKey(user.Id))
|
if (!waTimer.ContainsKey(user.Id))
|
||||||
ResetWantedTimeToElapse(player);
|
ResetWantedTimeToElapse(user);
|
||||||
|
|
||||||
bool isNearCop = false;
|
bool isNearCop = false;
|
||||||
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
||||||
@@ -70,7 +66,7 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
|
|
||||||
if (waTimer[user.Id] <= 0)
|
if (waTimer[user.Id] <= 0)
|
||||||
{
|
{
|
||||||
ResetWantedTimeToElapse(player);
|
ResetWantedTimeToElapse(user);
|
||||||
player.SendChatMessage("~y~Du hast erfolgreich einen Wanted abgetaucht.");
|
player.SendChatMessage("~y~Du hast erfolgreich einen Wanted abgetaucht.");
|
||||||
user.Wanteds -= 1;
|
user.Wanteds -= 1;
|
||||||
if (user.Wanteds == 0)
|
if (user.Wanteds == 0)
|
||||||
@@ -82,7 +78,15 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
waTimer[user.Id] = WantedEscapeTime;
|
waTimer[user.Id] = WantedEscapeTime;
|
||||||
}
|
}
|
||||||
else if (!isNearCop)
|
else if (!isNearCop)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("SERVER:SetWantedFlash", true);
|
||||||
waTimer[user.Id] -= 2500;
|
waTimer[user.Id] -= 2500;
|
||||||
|
}
|
||||||
|
else if (isNearCop)
|
||||||
|
{
|
||||||
|
player.TriggerEvent("SERVER:SetWantedFlash", false);
|
||||||
|
ResetWantedTimeToElapse(user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,15 @@ namespace ReallifeGamemode.Server.WeaponDeal
|
|||||||
public static bool checkWeaponDbyVehicle(Vehicle vehicle)
|
public static bool checkWeaponDbyVehicle(Vehicle vehicle)
|
||||||
{
|
{
|
||||||
if (!vehicle.HasData("WeaponDealLoad") || vehicle.GetData<bool>("WeaponDealLoad") == false)
|
if (!vehicle.HasData("WeaponDealLoad") || vehicle.GetData<bool>("WeaponDealLoad") == false)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!vehicle.HasData("weaponDeal") || vehicle.GetData<bool>("weapionDeal") == false)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user