forked from Simnation/Main
ed
This commit is contained in:
parent
fae041a7d8
commit
b08002a606
5 changed files with 1 additions and 132 deletions
|
@ -57,7 +57,7 @@ Config.AllowedClass = {18} -- Vehicle classes allowed to use the dashcam feature
|
|||
|
||||
Config.WatchLoc = {
|
||||
[1] = {
|
||||
coords = vector3(440.149445, -979.437378, 30.453491),
|
||||
coords = vector3(366.9329, -1588.3933, 30.5363),
|
||||
rad = 1.5,
|
||||
debug = false,
|
||||
jobCam = {'police','ambulance'}, -- jobs mentioned here are shown in the list | false = able to view all the bodycams
|
||||
|
|
|
@ -1,87 +0,0 @@
|
|||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
local MenuPool = NativeUI.CreatePool()
|
||||
local MainMenu = NativeUI.CreateMenu("Admin Menü", "Optionen auswählen")
|
||||
|
||||
MenuPool:Add(MainMenu)
|
||||
|
||||
-- Variables
|
||||
local zoneRadius = 50.0
|
||||
local zoneBlip = nil
|
||||
|
||||
-- Sperrzone erstellen
|
||||
function AddZoneMenu(menu)
|
||||
local submenu = MenuPool:AddSubMenu(menu, "Sperrzone")
|
||||
local radiusItem = NativeUI.CreateSliderItem("Radius", {50, 100, 200, 300, 400, 500}, 1, false, "Wähle die Größe der Zone")
|
||||
submenu:AddItem(radiusItem)
|
||||
|
||||
local createZoneItem = NativeUI.CreateItem("Zone erstellen", "Erstellt eine Sperrzone")
|
||||
submenu:AddItem(createZoneItem)
|
||||
|
||||
submenu.OnItemSelect = function(sender, item, index)
|
||||
if item == createZoneItem then
|
||||
local playerPed = PlayerPedId()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
|
||||
-- Zone erstellen
|
||||
if zoneBlip then RemoveBlip(zoneBlip) end
|
||||
zoneBlip = AddBlipForRadius(coords.x, coords.y, coords.z, zoneRadius)
|
||||
SetBlipColour(zoneBlip, 1)
|
||||
SetBlipAlpha(zoneBlip, 128)
|
||||
|
||||
QBCore.Functions.Notify("Sperrzone erstellt mit Radius: " .. zoneRadius .. " Meter", "success")
|
||||
elseif item == radiusItem then
|
||||
zoneRadius = radiusItem:IndexToItem(index)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Serverweite Ankündigungen
|
||||
function AddAnnouncementMenu(menu)
|
||||
local submenu = MenuPool:AddSubMenu(menu, "Ankündigungen")
|
||||
local announcementItem = NativeUI.CreateItem("Nachricht senden", "Sende eine Nachricht an alle Spieler")
|
||||
submenu:AddItem(announcementItem)
|
||||
|
||||
submenu.OnItemSelect = function(sender, item, index)
|
||||
if item == announcementItem then
|
||||
local message = KeyboardInput("Gib die Nachricht ein:", "", 200)
|
||||
if message then
|
||||
TriggerServerEvent("qbcore:announcement", message)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Tastendruck zum Öffnen des Menüs
|
||||
Citizen.CreateThread(function()
|
||||
AddZoneMenu(MainMenu)
|
||||
AddAnnouncementMenu(MainMenu)
|
||||
|
||||
MenuPool:RefreshIndex()
|
||||
|
||||
while true do
|
||||
Citizen.Wait(0)
|
||||
MenuPool:ProcessMenus()
|
||||
|
||||
if IsControlJustReleased(0, Config.OpenMenuKey) then
|
||||
local playerData = QBCore.Functions.GetPlayerData()
|
||||
if Config.AllowedJobs[playerData.job.name] then
|
||||
MainMenu:Visible(not MainMenu:Visible())
|
||||
else
|
||||
QBCore.Functions.Notify("Du hast keine Berechtigung, dieses Menü zu verwenden.", "error")
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function KeyboardInput(textEntry, exampleText, maxStringLength)
|
||||
AddTextEntry('FMMC_KEY_TIP1', textEntry)
|
||||
DisplayOnscreenKeyboard(1, "FMMC_KEY_TIP1", "", exampleText, "", "", "", maxStringLength)
|
||||
while UpdateOnscreenKeyboard() == 0 do
|
||||
DisableAllControlActions(0)
|
||||
Wait(0)
|
||||
end
|
||||
if GetOnscreenKeyboardResult() then
|
||||
return GetOnscreenKeyboardResult()
|
||||
end
|
||||
return nil
|
||||
end
|
|
@ -1,10 +0,0 @@
|
|||
Config = {}
|
||||
|
||||
-- Liste der erlaubten Jobs
|
||||
Config.AllowedJobs = {
|
||||
'police',
|
||||
'admin'
|
||||
}
|
||||
|
||||
-- Standard-Taste zum Öffnen des Menüs
|
||||
Config.OpenMenuKey = 'F5'
|
|
@ -1,18 +0,0 @@
|
|||
fx_version 'cerulean'
|
||||
game 'gta5'
|
||||
author 'Nordi98'
|
||||
description 'QBCore Script für Sperrzonen und Ankündigungen'
|
||||
version '1.0.0'
|
||||
|
||||
client_scripts {
|
||||
'client/main.lua',
|
||||
'@NativeUI/NativeUI.lua'
|
||||
}
|
||||
|
||||
server_scripts {
|
||||
'server/main.lua'
|
||||
}
|
||||
|
||||
shared_scripts {
|
||||
'config.lua'
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
RegisterServerEvent("qbcore:announcement")
|
||||
AddEventHandler("qbcore:announcement", function(message)
|
||||
local src = source
|
||||
local player = QBCore.Functions.GetPlayer(src)
|
||||
|
||||
if player and Config.AllowedJobs[player.PlayerData.job.name] then
|
||||
TriggerClientEvent('chat:addMessage', -1, {
|
||||
template = '<div class="chat-message system"><b>Ankündigung:</b> {0}</div>',
|
||||
args = { message }
|
||||
})
|
||||
else
|
||||
TriggerClientEvent('QBCore:Notify', src, "Du bist nicht berechtigt, eine Ankündigung zu senden.", "error")
|
||||
end
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue