Merge branch 'develop' of ssh://development.life-of-german.org:451/log-gtav/reallife-gamemode into develop
This commit is contained in:
@@ -16,6 +16,9 @@ export default function (globalData: GlobalData): void {
|
||||
var adutyMode = false;
|
||||
var dutyMode = false;
|
||||
let jailTime = 0;
|
||||
let countdown = 0;
|
||||
var cdTimestamp;
|
||||
var countdownText;
|
||||
|
||||
let posX = 0.92;
|
||||
let posY = 0.45;
|
||||
@@ -47,7 +50,6 @@ export default function (globalData: GlobalData): void {
|
||||
playerName = pName;
|
||||
playerId = pId;
|
||||
draw = true;
|
||||
|
||||
});
|
||||
|
||||
mp.events.add('toggleADutyMode', (toggle) => {
|
||||
@@ -66,6 +68,12 @@ export default function (globalData: GlobalData): void {
|
||||
jailTime = time;
|
||||
});
|
||||
|
||||
mp.events.add("countdown", (timer, text) => {
|
||||
countdown = timer;
|
||||
cdTimestamp = Date.now();
|
||||
countdownText = text;
|
||||
});
|
||||
|
||||
|
||||
mp.events.add("toggleUi", (show) => {
|
||||
if (show === false) {
|
||||
@@ -256,5 +264,23 @@ export default function (globalData: GlobalData): void {
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
|
||||
if (countdown > 0) {
|
||||
var now = Date.now();
|
||||
var diff = Math.trunc((now - cdTimestamp) / 1000);
|
||||
var out = countdown - diff;
|
||||
if (out < 0) {
|
||||
countdown = 0
|
||||
} else {
|
||||
mp.game.graphics.drawText("~y~" + countdownText + ": " + out + "", [0.5, 0.8],
|
||||
{
|
||||
font: 7,
|
||||
color: [64, 224, 208, 255],
|
||||
scale: [1.5, 1.5],
|
||||
outline: true,
|
||||
centre: false
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
26
ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs
Normal file
26
ReallifeGamemode.Server/Business/AirplaneDealerBusiness.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Business
|
||||
{
|
||||
class AirplaneDealerBusiness : CarDealerBusinessBase
|
||||
{
|
||||
|
||||
public override int Id => 7;
|
||||
|
||||
public override string Name => "Flugzeug Shop";
|
||||
|
||||
public override Vector3 Position => new Vector3(-941.5253, -2954.994, 13.94508);
|
||||
|
||||
public override Vector3 CarSpawnPositon => new Vector3(-1029.062, -2972.129, 13.94598);
|
||||
|
||||
public override float CarSpawnHeading => 356.6f;
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,6 +353,24 @@ namespace ReallifeGamemode.Server.Commands
|
||||
#endregion
|
||||
|
||||
#region ALevel1
|
||||
|
||||
[Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true)]
|
||||
public void CmdCountdown(Client player, string timer_string, string text)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
int timer = int.Parse(timer_string);
|
||||
|
||||
foreach (Client c in NAPI.Pools.GetAllPlayers())
|
||||
{
|
||||
c.TriggerEvent("countdown", timer, text);
|
||||
}
|
||||
}
|
||||
|
||||
[Command("aunjail", "~m~Benutzung: ~s~/aunjail [Spieler]", GreedyArg = true)]
|
||||
public void CmdAdminAunjai(Client player, string targetname)
|
||||
{
|
||||
@@ -360,6 +378,12 @@ namespace ReallifeGamemode.Server.Commands
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
|
||||
ReallifeGamemode.Server.Wanted.Jail.Release_Jail_Admin(player, target);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user