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) => {
|
||||
browser.execute(`setWanteds(${count});`);
|
||||
});
|
||||
|
||||
mp.events.add("SERVER:SetWantedFlash", (flash) => {
|
||||
browser.execute(`setFlashing(${flash});`);
|
||||
});
|
||||
}
|
||||
@@ -23,7 +23,8 @@
|
||||
-2084633992,
|
||||
-1075685676,
|
||||
-1786099057,
|
||||
-1074790547
|
||||
-1074790547,
|
||||
-1569615261
|
||||
]
|
||||
|
||||
mp.events.add("playerJoin", () => {
|
||||
@@ -152,7 +153,6 @@
|
||||
checkWeaponhash() {
|
||||
let h = this.weapon;
|
||||
if (allowedWeaponHashes.indexOf(h) === -1) {
|
||||
mp.gui.chat.push("unallowed weapon: " + h);
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -189,12 +189,12 @@
|
||||
let Difference = Behaviour.subtractVector(Behaviour.pos, mp.players.local.position)
|
||||
if (Math.abs(Difference.x) > 30 || Math.abs(Difference.y) > 30) {
|
||||
if (Behaviour.isWalking()) {
|
||||
mp.events.callRemote("CLIENT:CheatDetection", "Flyhack/Teleport")
|
||||
//mp.events.callRemote("CLIENT:CheatDetection", "Flyhack/Teleport")
|
||||
}
|
||||
}
|
||||
if (mp.players.local.vehicle) {
|
||||
if (Behaviour.checkCarPos(25)) {
|
||||
mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Flyhack")
|
||||
//mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Flyhack")
|
||||
}
|
||||
if (Behaviour.VehicleFasterThan(250)) {
|
||||
mp.events.callRemote("CLIENT:CheatDetection", "Vehicle Speedhack")
|
||||
|
||||
@@ -1,60 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<title>Wanteds</title>
|
||||
|
||||
<style>
|
||||
@font-face { font-family: 'Pricedown'; src: url('package://assets/font/Pricedown.ttf'); }
|
||||
html, body { margin: 0; padding: 0; }
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<title>Wanteds</title>
|
||||
|
||||
#wanteds {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
top: 65px;
|
||||
right: 22px;
|
||||
user-select: none;
|
||||
}
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Pricedown';
|
||||
src: url('package://assets/font/Pricedown.ttf');
|
||||
}
|
||||
|
||||
#wanteds img {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-right: 5px;
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
filter: drop-shadow(0px 0px 1px #000000);
|
||||
-webkit-filter: drop-shadow(0px 0px 1px #000000);
|
||||
-moz-filter: drop-shadow(0px 0px 1px #000000);
|
||||
}
|
||||
#wanteds {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
top: 65px;
|
||||
right: 22px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#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>
|
||||
#wanteds img {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-right: 5px;
|
||||
filter: drop-shadow(0px 0px 1px #000000);
|
||||
-webkit-filter: drop-shadow(0px 0px 1px #000000);
|
||||
-moz-filter: drop-shadow(0px 0px 1px #000000);
|
||||
}
|
||||
|
||||
#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>
|
||||
|
||||
<body>
|
||||
<div id="wanteds" style="display: none;">
|
||||
<img src="package://assets/img/wanteds/star.svg"> <span id="wanted-count">10</span>
|
||||
</div>
|
||||
<div id="wanteds" style="display: none;">
|
||||
<img src="package://assets/img/wanteds/star.svg" id="wanted-star"> <span id="wanted-count">10</span>
|
||||
</div>
|
||||
|
||||
<script src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function setWanteds(count) {
|
||||
if (count === 0) {
|
||||
$("#wanteds").hide();
|
||||
} else {
|
||||
$("#wanteds").show();
|
||||
$("#wanted-count").text(count.toString());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script src="package://assets/js/jquery-3.3.1.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function setWanteds(count) {
|
||||
if (count === 0) {
|
||||
$("#wanteds").hide();
|
||||
} else {
|
||||
$("#wanteds").show();
|
||||
$("#wanted-count").text(count.toString());
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
</html>
|
||||
@@ -26,7 +26,7 @@ namespace ReallifeGamemode.Server.Admin
|
||||
{
|
||||
if (!cheater.IsLoggedIn())
|
||||
{
|
||||
cheater.Kick();
|
||||
return;
|
||||
}
|
||||
|
||||
if(cheater.IsAdminDuty())
|
||||
|
||||
@@ -841,13 +841,13 @@ namespace ReallifeGamemode.Server.Commands
|
||||
dbContext.SaveChanges();
|
||||
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.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]")]
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
//player.SetSharedData("vehicleAdminSpeed2", 1.0);
|
||||
player.SetData("isLoggedIn", false);
|
||||
player.SafeTeleport(new Vector3(-1883.736, -781.4911, -10));
|
||||
player.Dimension = (uint)(player.Handle.Value + 1);
|
||||
|
||||
bool registered = false;
|
||||
|
||||
|
||||
@@ -238,8 +238,12 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
player.RemoveAllWeapons();
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,13 @@ namespace ReallifeGamemode.Server.Events
|
||||
public void OnPlayerDisconnected(Player player, DisconnectionType type, string reason)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
using var saveUser = new DatabaseContext();
|
||||
User user = player.GetUser(saveUser);
|
||||
|
||||
if(user == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == DisconnectionType.Left)
|
||||
{
|
||||
@@ -49,7 +56,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
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);
|
||||
}
|
||||
@@ -74,8 +81,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
Report.Report.listReports.Remove(temp);
|
||||
|
||||
Player user = PlayerService.GetPlayerByNameOrId(temp.getUser());
|
||||
user.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der Admin hat den Server verlassen");
|
||||
Player ticketUser = PlayerService.GetPlayerByNameOrId(temp.getUser());
|
||||
ticketUser.SendChatMessage("!{#008fff}[REPORT]!{#FFFFFF} Chat beendet. Der Admin hat den Server verlassen");
|
||||
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);
|
||||
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");
|
||||
}
|
||||
|
||||
ChatService.HQMessage("Der Straftäter " + user.Name + " ist vom Radar verschwunden");
|
||||
}
|
||||
|
||||
player.SetData("isLoggedIn", false);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 1);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 2);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 3);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 3);
|
||||
player.TriggerEvent("CLIENT:DestroyPed", 4);
|
||||
|
||||
Medic.delHealTask(player);
|
||||
|
||||
@@ -144,6 +144,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
Jail.Check_PutBehindBars(user);
|
||||
}
|
||||
|
||||
player.Dimension = 0;
|
||||
}
|
||||
|
||||
player.TriggerEvent("draw", player.Name, player.Handle.Value);
|
||||
|
||||
@@ -31,8 +31,9 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
/// <returns></returns>
|
||||
public static User GetUser(this Player client, DatabaseContext context = null)
|
||||
{
|
||||
context = context ?? new DatabaseContext();
|
||||
if (!client.IsLoggedIn()) return null;
|
||||
|
||||
context = context ?? new DatabaseContext();
|
||||
return context
|
||||
.Users
|
||||
.Include(u => u.Faction)
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace ReallifeGamemode.Server.Report
|
||||
//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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -45,7 +41,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
if (user != null && user.Wanteds > 0)
|
||||
{
|
||||
if (!waTimer.ContainsKey(user.Id))
|
||||
ResetWantedTimeToElapse(player);
|
||||
ResetWantedTimeToElapse(user);
|
||||
|
||||
bool isNearCop = false;
|
||||
foreach (var playerCop in NAPI.Pools.GetAllPlayers())
|
||||
@@ -70,7 +66,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
|
||||
if (waTimer[user.Id] <= 0)
|
||||
{
|
||||
ResetWantedTimeToElapse(player);
|
||||
ResetWantedTimeToElapse(user);
|
||||
player.SendChatMessage("~y~Du hast erfolgreich einen Wanted abgetaucht.");
|
||||
user.Wanteds -= 1;
|
||||
if (user.Wanteds == 0)
|
||||
@@ -82,7 +78,15 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
waTimer[user.Id] = WantedEscapeTime;
|
||||
}
|
||||
else if (!isNearCop)
|
||||
{
|
||||
player.TriggerEvent("SERVER:SetWantedFlash", true);
|
||||
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)
|
||||
{
|
||||
if (!vehicle.HasData("WeaponDealLoad") || vehicle.GetData<bool>("WeaponDealLoad") == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(!vehicle.HasData("weaponDeal") || vehicle.GetData<bool>("weapionDeal") == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user