admin unshow und tsupport links anzeigen
This commit is contained in:
@@ -26,13 +26,22 @@
|
||||
}
|
||||
let pBlip = playerBlipMap.get(player);
|
||||
if (player.isDead()) {
|
||||
pBlip.setSprite(303);
|
||||
pBlip.setSprite(274);
|
||||
pBlip.setScale(0.5);
|
||||
} else {
|
||||
pBlip.setSprite(1);
|
||||
pBlip.setSprite(0.7);
|
||||
}
|
||||
let color = player.getVariable("blipColor");
|
||||
pBlip.setColour(isNaN(color) ? 0 : color);
|
||||
pBlip.setPosition(player.position.x, player.position.y, player.position.z);
|
||||
|
||||
if (color === -1) {
|
||||
pBlip.setAlpha(0);
|
||||
} else {
|
||||
pBlip.setAlpha(200);
|
||||
|
||||
pBlip.setColour(isNaN(color) ? 0 : color);
|
||||
pBlip.setPosition(player.position.x, player.position.y, player.position.z);
|
||||
}
|
||||
|
||||
});
|
||||
}, 50);
|
||||
|
||||
@@ -14,6 +14,8 @@ export default function (globalData: IGlobalData): void {
|
||||
var draw = false;
|
||||
var editMode = false;
|
||||
var adutyMode = false;
|
||||
var adminUnshow = false;
|
||||
var adminTSupport = false;
|
||||
var dutyMode = false;
|
||||
let jailTime = 0;
|
||||
let att_score = 0;
|
||||
@@ -62,6 +64,14 @@ export default function (globalData: IGlobalData): void {
|
||||
adutyMode = toggle;
|
||||
});
|
||||
|
||||
mp.events.add('toggleTSupportMode', (toggle) => {
|
||||
adminTSupport = toggle;
|
||||
});
|
||||
|
||||
mp.events.add('toggleAdminUnshowMode', (toggle) => {
|
||||
adminUnshow = toggle;
|
||||
});
|
||||
|
||||
mp.events.add("toggleEditMode", (toggle) => {
|
||||
editMode = toggle;
|
||||
});
|
||||
@@ -300,16 +310,6 @@ export default function (globalData: IGlobalData): void {
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
if (adutyMode === true) {
|
||||
mp.game.graphics.drawText("~r~SUPPORT", [0.92, 0.6],
|
||||
{
|
||||
font: 2,
|
||||
color: [0, 255, 255, 255],
|
||||
scale: [0.7, 0.7],
|
||||
outline: true,
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
if (dutyMode === true) {
|
||||
mp.game.graphics.drawText("~r~Duty", [0.92, 0.55],
|
||||
{
|
||||
@@ -320,7 +320,31 @@ export default function (globalData: IGlobalData): void {
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
|
||||
if (adutyMode === true) {
|
||||
var adutyText = "~r~SUPPORT";
|
||||
if (adminTSupport) {
|
||||
adutyText = "SUPPORT";
|
||||
}
|
||||
mp.game.graphics.drawText(adutyText, [0.92, 0.6],
|
||||
{
|
||||
font: 2,
|
||||
color: [0, 229, 238, 255],
|
||||
scale: [0.7, 0.7],
|
||||
outline: true,
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
if (adminUnshow) {
|
||||
mp.game.graphics.drawText("~r~UNSHOW", [0.92, 0.65],
|
||||
{
|
||||
font: 2,
|
||||
color: [0, 255, 255, 255],
|
||||
scale: [0.7, 0.7],
|
||||
outline: true,
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
|
||||
if (countdown > 0) {
|
||||
var now = Date.now();
|
||||
var diff = Math.trunc((now - cdTimestamp) / 1000);
|
||||
|
||||
@@ -49,6 +49,10 @@ export default function customNametags() {
|
||||
|
||||
let colorId = game.players.at(player.remoteId).nametagColor;
|
||||
|
||||
if (colorId === -3) {
|
||||
return;
|
||||
}
|
||||
|
||||
let color = colors.find(c => c.id === colorId).color;
|
||||
|
||||
let nametagText = player.name + " (" + player.remoteId + ")";
|
||||
|
||||
30
ReallifeGamemode.Database/Entities/Logs/LogEntry.cs
Normal file
30
ReallifeGamemode.Database/Entities/Logs/LogEntry.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Database.Entities.Logs
|
||||
{
|
||||
public class LogEntry
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
public User User { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
public User AffectedBy { get; set; }
|
||||
|
||||
public int? AffectedById { get; set; }
|
||||
|
||||
public Faction AffectedFaction { get; set; }
|
||||
|
||||
public int? AffectedFactionId { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public DateTime Time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -259,11 +259,13 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
if (player.GetData<bool>("SAdminduty") == false)
|
||||
{
|
||||
player.TriggerEvent("toggleTSupportMode", true);
|
||||
player.SetData("SAdminduty", true);
|
||||
ChatService.SendMessage(player, "~g~ ** " + "Du befindest dich im T-Support");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.TriggerEvent("toggleTSupportMode", false);
|
||||
player.SetData("SAdminduty", false);
|
||||
ChatService.SendMessage(player, "!{#ee4d2e}** " + "Du befindest dich nicht mehr im T-Support");
|
||||
}
|
||||
@@ -1442,6 +1444,33 @@ namespace ReallifeGamemode.Server.Commands
|
||||
Medic.delReviveTask(target);
|
||||
}
|
||||
|
||||
[Command("aunshow", "~m~Benutzung:~s~ /aunshow")]
|
||||
public void CmdAdminUnshow(Player player)
|
||||
{
|
||||
User user = player.GetUser();
|
||||
if (!user.IsAdmin(AdminLevel.HEADADMIN))
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
bool currentStatus = user.GetData<bool>("adminUnshow");
|
||||
currentStatus = !currentStatus;
|
||||
user.SetData("adminUnshow", currentStatus);
|
||||
player.TriggerEvent("toggleAdminUnshowMode", currentStatus);
|
||||
|
||||
user.SetBlipAndNametagColor();
|
||||
|
||||
if(currentStatus)
|
||||
{
|
||||
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du bist nun Unshow");
|
||||
}
|
||||
else
|
||||
{
|
||||
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du bist nun nicht mehr Unshow");
|
||||
}
|
||||
}
|
||||
|
||||
[Command("setap", "~m~Benutzung: ~s~/setap [Spieler] (Armor)")]
|
||||
public void CmdAdminSetAP(Player player, string name, int armor = 100)
|
||||
{
|
||||
|
||||
@@ -345,8 +345,14 @@ namespace ReallifeGamemode.Server.Extensions
|
||||
}
|
||||
|
||||
bool duty = user.GetData<bool>("duty");
|
||||
bool adminUnshow = user.GetData<bool>("adminUnshow");
|
||||
|
||||
if (player.GetData<bool>("SAdminduty"))
|
||||
if(adminUnshow)
|
||||
{
|
||||
blipColor = -1;
|
||||
nameTagColor = -3;
|
||||
}
|
||||
else if (player.GetData<bool>("SAdminduty"))
|
||||
{
|
||||
blipColor = 30;
|
||||
nameTagColor = -2;
|
||||
|
||||
Reference in New Issue
Block a user