sani revive tote wanteds
This commit is contained in:
34
ReallifeGamemode.Client/Event/event.ts
Normal file
34
ReallifeGamemode.Client/Event/event.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import * as NativeUI from '../libs/NativeUI';
|
||||
|
||||
const Menu = NativeUI.Menu;
|
||||
const UIMenuItem = NativeUI.UIMenuItem;
|
||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||
const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem;
|
||||
const BadgeStyle = NativeUI.BadgeStyle;
|
||||
const Point = NativeUI.Point;
|
||||
const ItemsCollection = NativeUI.ItemsCollection;
|
||||
const Color = NativeUI.Color;
|
||||
|
||||
let ggbItem = new UIMenuItem("Gut gegen Boese", "");
|
||||
ggbItem.BackColor = new Color(42, 46, 49);
|
||||
|
||||
export default function createEvent(globalData: IGlobalData) {
|
||||
|
||||
var eventMenu: NativeUI.Menu;
|
||||
let screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
|
||||
mp.events.add('showEventMenu', () => {
|
||||
|
||||
if (!globalData.InMenu) {
|
||||
globalData.InMenu = true;
|
||||
|
||||
eventMenu = new Menu("Event starten", "", new Point(0, screenRes.y / 3), null, null);
|
||||
eventMenu.AddItem(ggbItem);
|
||||
eventMenu.Visible = true;
|
||||
|
||||
eventMenu.MenuClose.on(() => {
|
||||
globalData.InMenu = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -545,6 +545,18 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
#region Admin
|
||||
|
||||
[Command("event", "~m~Benutzung: ~s~/event")]
|
||||
public void CmdAdminEvent(Player player)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
player.TriggerEvent("showEventMenu");
|
||||
}
|
||||
|
||||
[Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true)]
|
||||
public void CmdAdminCountdown(Player player, string timer_string, string text)
|
||||
{
|
||||
|
||||
@@ -402,10 +402,17 @@ namespace ReallifeGamemode.Server.Commands
|
||||
ChatService.ErrorMessage(player, "Der Spieler hat eine Revivesperre");
|
||||
return;
|
||||
}
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
var deadPlayerUser = deadPlayer.GetUser(dbContext);
|
||||
|
||||
if (deadPlayerUser.Wanteds > 0)
|
||||
{
|
||||
ChatService.ErrorMessage(player, "Dieser Spieler hat Wanteds");
|
||||
return;
|
||||
}
|
||||
|
||||
if (deadPlayerUser.Handmoney >= 100)
|
||||
{
|
||||
deadPlayerUser.Handmoney -= 100;
|
||||
|
||||
Reference in New Issue
Block a user