ja
This commit is contained in:
@@ -19,6 +19,7 @@ export default function (globalData: GlobalData): void {
|
||||
let countdown = 0;
|
||||
var cdTimestamp;
|
||||
var countdownText;
|
||||
var blackScreenMode = false;
|
||||
|
||||
let posX = 0.92;
|
||||
let posY = 0.45;
|
||||
@@ -64,6 +65,10 @@ export default function (globalData: GlobalData): void {
|
||||
dutyMode = toggle;
|
||||
});
|
||||
|
||||
mp.events.add("toggleBlackScreen", (toggle) => {
|
||||
blackScreenMode = toggle;
|
||||
});
|
||||
|
||||
mp.events.add("jailTime", (time) => {
|
||||
jailTime = time;
|
||||
});
|
||||
@@ -282,5 +287,9 @@ export default function (globalData: GlobalData): void {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (blackScreenMode == true) {
|
||||
mp.game.graphics.drawRect(0, 0, 10000, 100000, 0, 0, 0, 255);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -167,4 +167,5 @@ export default function reportList(globalData: GlobalData) {
|
||||
reportMenu.Close();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@@ -158,3 +158,6 @@ vehicleIndicators();
|
||||
|
||||
import reportList from './Player/reportmenu';
|
||||
reportList(globalData);
|
||||
|
||||
import checkpointHandle from './util/checkpoint';
|
||||
checkpointHandle(globalData);
|
||||
35
ReallifeGamemode.Client/util/checkpoint.ts
Normal file
35
ReallifeGamemode.Client/util/checkpoint.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import * as NativeUI from 'NativeUI';
|
||||
import InputHelper from '../inputhelper';
|
||||
|
||||
export default function checkpointHandle(globalData: GlobalData) {
|
||||
var count = 0;
|
||||
var myVar;
|
||||
var posCp;
|
||||
var Player;
|
||||
var activeCheckpoint;
|
||||
var inCheckpoint = false;
|
||||
|
||||
mp.events.add('setCheckPoint', (position, player) => {
|
||||
mp.gui.chat.push("exec");
|
||||
posCp = position;
|
||||
Player = player;
|
||||
activeCheckpoint = mp.markers.new(1, posCp, 3.0, {
|
||||
color: [255, 0, 0, 150],
|
||||
visible: true,
|
||||
dimension: 0
|
||||
});
|
||||
|
||||
myVar = setInterval(myTimer, 100);
|
||||
});
|
||||
|
||||
function myTimer() {
|
||||
let dist = mp.game.gameplay.getDistanceBetweenCoords(Player.position.x, Player.position.y, 0, posCp.x, posCp.y, 0, false);
|
||||
|
||||
if (dist <= 2 && !inCheckpoint) {
|
||||
inCheckpoint = true;
|
||||
mp.events.callRemote("playerInCheckpoint");
|
||||
} else if (dist > 2) {
|
||||
inCheckpoint = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ using ReallifeGamemode.Server.Models;
|
||||
using ReallifeGamemode.Server.Job;
|
||||
using ReallifeGamemode.Server.Finance;
|
||||
using ReallifeGamemode.Server.Wanted;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
/**
|
||||
* @overview Life of German Reallife - Admin Commands (Admin.cs)
|
||||
@@ -2599,12 +2598,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
dbContext.Users.Where(u => u.Id == nearHouse.OwnerId).First().HouseId = null;
|
||||
}
|
||||
|
||||
foreach(HouseRental rental in dbContext.HouseRentals.Include(r => r.User).Where(r => r.HouseId == nearHouse.Id))
|
||||
{
|
||||
rental.User.Client?.SendChatMessage("Dein Mietvertrag wurde administrativ aufgelöst");
|
||||
dbContext.HouseRentals.Remove(rental);
|
||||
}
|
||||
|
||||
dbContext.Houses.Remove(nearHouse);
|
||||
dbContext.SaveChanges();
|
||||
|
||||
@@ -2906,10 +2899,31 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
}
|
||||
|
||||
[Command("blind", "~m~Benutzung: ~s~/blind")]
|
||||
public void CmdBlind(Client player, String name, int mode)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
Client target = ClientService.GetClientByNameOrId(name);
|
||||
|
||||
if (mode == 1)
|
||||
{
|
||||
player.TriggerEvent("toggleBlackScreen", true);
|
||||
} else if (mode == 0)
|
||||
{
|
||||
player.TriggerEvent("toggleBlackScreen", false);
|
||||
}
|
||||
}
|
||||
|
||||
[Command("makeadmin", "~m~Benutzung: ~s~/makeadmin [Name] [Adminlevel]")]
|
||||
public void CmdAdminSetadmin(Client player, string name, int rank)
|
||||
{
|
||||
if ((!player.GetUser()?.IsAdmin(AdminLevel.PROJEKTLEITUNG) ?? true))
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.PROJEKTLEITUNG) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
{
|
||||
class UserCommands : Script
|
||||
{
|
||||
|
||||
[Command("dice", "~m~Benutzung: ~s~/dice")]
|
||||
public void CmdUserDice(Client player)
|
||||
{
|
||||
@@ -30,7 +29,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Command("car", "~m~Benutzung: ~s~/car")]
|
||||
public void CmdUserCar(Client player)
|
||||
{
|
||||
|
||||
35
ReallifeGamemode.Server/Util/CheckPointHandle.cs
Normal file
35
ReallifeGamemode.Server/Util/CheckPointHandle.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Server.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Finance;
|
||||
using ReallifeGamemode.Server.Models;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using GTANetworkAPI;
|
||||
|
||||
namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
class CheckPointHandle : Script
|
||||
{
|
||||
[Command("cp", "~m~Benutzung: ~s~/cp")]
|
||||
public void CmdCp(Client player)
|
||||
{
|
||||
if (!player.IsLoggedIn()) return;
|
||||
|
||||
Vector3 cp = player.Position;
|
||||
|
||||
cp.X += 10;
|
||||
player.TriggerEvent("setCheckPoint", cp, player);
|
||||
}
|
||||
|
||||
[RemoteEvent("playerInCheckpoint")]
|
||||
public void enteredCheckpoints(Client user)
|
||||
{
|
||||
ChatService.SendMessage(user, "ja");
|
||||
Vector3 newCp = new Vector3(400, 680, 29);
|
||||
user.TriggerEvent("setCheckpoint", newCp, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user