fixes
This commit is contained in:
		
							parent
							
								
									fb68aaa337
								
							
						
					
					
						commit
						35451d0d0f
					
				
					 71 changed files with 3 additions and 6158 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/.fxap
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/.fxap
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -0,0 +1,159 @@
 | 
			
		|||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<AudioWaveContainer>
 | 
			
		||||
    <Version value="1" />
 | 
			
		||||
    <ChunkIndices value="True" />
 | 
			
		||||
    <MultiChannelEncrypt value="True" />
 | 
			
		||||
    <WholeFileEncrypt value="True" />
 | 
			
		||||
    <Streams>
 | 
			
		||||
        <Item>
 | 
			
		||||
            <Name>shoot01</Name>
 | 
			
		||||
            <FileName>shoot01.wav</FileName>
 | 
			
		||||
            <Chunks>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>peak</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>data</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>format</Type>
 | 
			
		||||
                    <Codec>PCM</Codec>
 | 
			
		||||
                    <Samples value="13467" />
 | 
			
		||||
                    <SampleRate value="32001" />
 | 
			
		||||
                    <Headroom value="-200" />
 | 
			
		||||
                    <PlayBegin value="0" />
 | 
			
		||||
                    <PlayEnd value="0" />
 | 
			
		||||
                    <LoopBegin value="0" />
 | 
			
		||||
                    <LoopEnd value="0" />
 | 
			
		||||
                    <LoopPoint value="-1" />
 | 
			
		||||
                    <Peak unk="0" />
 | 
			
		||||
                </Item>
 | 
			
		||||
            </Chunks>
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item>
 | 
			
		||||
            <Name>shoot02</Name>
 | 
			
		||||
            <FileName>shoot02.wav</FileName>
 | 
			
		||||
            <Chunks>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>peak</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>data</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>format</Type>
 | 
			
		||||
                    <Codec>PCM</Codec>
 | 
			
		||||
                    <Samples value="12238" />
 | 
			
		||||
                    <SampleRate value="32001" />
 | 
			
		||||
                    <Headroom value="-198" />
 | 
			
		||||
                    <PlayBegin value="0" />
 | 
			
		||||
                    <PlayEnd value="0" />
 | 
			
		||||
                    <LoopBegin value="0" />
 | 
			
		||||
                    <LoopEnd value="0" />
 | 
			
		||||
                    <LoopPoint value="-1" />
 | 
			
		||||
                    <Peak unk="0" />
 | 
			
		||||
                </Item>
 | 
			
		||||
            </Chunks>
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item>
 | 
			
		||||
            <Name>shoot03</Name>
 | 
			
		||||
            <FileName>shoot03.wav</FileName>
 | 
			
		||||
            <Chunks>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>peak</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>data</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>format</Type>
 | 
			
		||||
                    <Codec>PCM</Codec>
 | 
			
		||||
                    <Samples value="13425" />
 | 
			
		||||
                    <SampleRate value="32000" />
 | 
			
		||||
                    <Headroom value="-200" />
 | 
			
		||||
                    <PlayBegin value="0" />
 | 
			
		||||
                    <PlayEnd value="0" />
 | 
			
		||||
                    <LoopBegin value="0" />
 | 
			
		||||
                    <LoopEnd value="0" />
 | 
			
		||||
                    <LoopPoint value="-1" />
 | 
			
		||||
                    <Peak unk="0" />
 | 
			
		||||
                </Item>
 | 
			
		||||
            </Chunks>
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item>
 | 
			
		||||
            <Name>shoot04</Name>
 | 
			
		||||
            <FileName>shoot04.wav</FileName>
 | 
			
		||||
            <Chunks>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>peak</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>data</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>format</Type>
 | 
			
		||||
                    <Codec>PCM</Codec>
 | 
			
		||||
                    <Samples value="14191" />
 | 
			
		||||
                    <SampleRate value="32000" />
 | 
			
		||||
                    <Headroom value="-200" />
 | 
			
		||||
                    <PlayBegin value="0" />
 | 
			
		||||
                    <PlayEnd value="0" />
 | 
			
		||||
                    <LoopBegin value="0" />
 | 
			
		||||
                    <LoopEnd value="0" />
 | 
			
		||||
                    <LoopPoint value="-1" />
 | 
			
		||||
                    <Peak unk="0" />
 | 
			
		||||
                </Item>
 | 
			
		||||
            </Chunks>
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item>
 | 
			
		||||
            <Name>shoot05</Name>
 | 
			
		||||
            <FileName>shoot05.wav</FileName>
 | 
			
		||||
            <Chunks>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>peak</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>data</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>format</Type>
 | 
			
		||||
                    <Codec>PCM</Codec>
 | 
			
		||||
                    <Samples value="14457" />
 | 
			
		||||
                    <SampleRate value="32000" />
 | 
			
		||||
                    <Headroom value="-200" />
 | 
			
		||||
                    <PlayBegin value="0" />
 | 
			
		||||
                    <PlayEnd value="0" />
 | 
			
		||||
                    <LoopBegin value="0" />
 | 
			
		||||
                    <LoopEnd value="0" />
 | 
			
		||||
                    <LoopPoint value="-1" />
 | 
			
		||||
                    <Peak unk="0" />
 | 
			
		||||
                </Item>
 | 
			
		||||
            </Chunks>
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item>
 | 
			
		||||
            <Name>shoot06</Name>
 | 
			
		||||
            <FileName>shoot06.wav</FileName>
 | 
			
		||||
            <Chunks>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>peak</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>data</Type>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <Type>format</Type>
 | 
			
		||||
                    <Codec>PCM</Codec>
 | 
			
		||||
                    <Samples value="11436" />
 | 
			
		||||
                    <SampleRate value="32001" />
 | 
			
		||||
                    <Headroom value="-64" />
 | 
			
		||||
                    <PlayBegin value="0" />
 | 
			
		||||
                    <PlayEnd value="0" />
 | 
			
		||||
                    <LoopBegin value="0" />
 | 
			
		||||
                    <LoopEnd value="0" />
 | 
			
		||||
                    <LoopPoint value="-1" />
 | 
			
		||||
                    <Peak unk="0" />
 | 
			
		||||
                </Item>
 | 
			
		||||
            </Chunks>
 | 
			
		||||
        </Item>
 | 
			
		||||
    </Streams>
 | 
			
		||||
</AudioWaveContainer>
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										201
									
								
								resources/[jobs]/[police]/gs_trackerdart/bridge/cl_bridge.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										201
									
								
								resources/[jobs]/[police]/gs_trackerdart/bridge/cl_bridge.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,201 @@
 | 
			
		|||
ESX = nil
 | 
			
		||||
QBCore = nil
 | 
			
		||||
 | 
			
		||||
if (GetResourceState('es_extended') == 'started') then
 | 
			
		||||
    ESX = exports['es_extended']:getSharedObject()
 | 
			
		||||
elseif (GetResourceState('qb-core') == 'started') then
 | 
			
		||||
    QBCore = exports['qb-core']:GetCoreObject()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions = {}
 | 
			
		||||
 | 
			
		||||
Functions.Notify = function(message)
 | 
			
		||||
    if ESX then
 | 
			
		||||
        ESX.ShowNotification(message, 'info', 5000)
 | 
			
		||||
    elseif QBCore then
 | 
			
		||||
        QBCore.Functions.Notify(message, 'primary', 5000)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.CanVehicleHaveDartSystem = function(vehicle)
 | 
			
		||||
    local vehicleModel = GetEntityModel(vehicle)
 | 
			
		||||
    if not Config.allowedVehicles[vehicleModel] then
 | 
			
		||||
        return false
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.CanVehicleShootDart = function(vehicle)
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.CanPlayerShootDart = function()
 | 
			
		||||
    -- For example: Add a job check if you wish
 | 
			
		||||
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Called every frame when the vehicle is in 'sight' of the tracker system
 | 
			
		||||
Functions.OnVehicleHit = function(targetVehicle, hitCoords)
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.CanOpenOverlay = function()
 | 
			
		||||
    local playerPed = PlayerPedId()
 | 
			
		||||
    local vehicle = GetVehiclePedIsIn(playerPed, false)
 | 
			
		||||
 | 
			
		||||
    if (vehicle == 0) then
 | 
			
		||||
        return false
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    -- Check if the ped is the driver
 | 
			
		||||
    local driverPed = GetPedInVehicleSeat(vehicle, -1)
 | 
			
		||||
    if (driverPed ~= playerPed) then
 | 
			
		||||
        return false
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if IsPedDeadOrDying(playerPed, true) then
 | 
			
		||||
        return false
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.HasJob = function()
 | 
			
		||||
    if not Config.allowedJobs then
 | 
			
		||||
        return true
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local playerJob = 'unemployed'
 | 
			
		||||
    if ESX then
 | 
			
		||||
        playerJob = ESX.GetPlayerData()?.job?.name or 'unemployed'
 | 
			
		||||
    elseif QBCore then
 | 
			
		||||
        playerJob = QBCore.Functions.GetPlayerData()?.job?.name or 'unemployed'
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return (Config.allowedJobs[playerJob] ~= nil)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.ShouldDisplayBlips = function()
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.RemoveDartMinigame = function()
 | 
			
		||||
    local areaSize = 40
 | 
			
		||||
    local speedMultiplier = 1.5
 | 
			
		||||
 | 
			
		||||
    for i = 1, 5 do
 | 
			
		||||
        local success = lib.skillCheck({ areaSize = areaSize, speedMultiplier = speedMultiplier }, { 'E' })
 | 
			
		||||
        if not success then
 | 
			
		||||
            return false
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        areaSize -= 2
 | 
			
		||||
        speedMultiplier += 0.05
 | 
			
		||||
 | 
			
		||||
        Wait(300)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.CanInteract = function(entity)
 | 
			
		||||
    local playerPed = PlayerPedId()
 | 
			
		||||
 | 
			
		||||
    if IsPedDeadOrDying(playerPed, true) then
 | 
			
		||||
        return false
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if IsPedInAnyVehicle(playerPed, false) then
 | 
			
		||||
        return false
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.CreateRemoveTarget = function(canInteract, onSelect)
 | 
			
		||||
    if (GetResourceState('ox_target') == 'started') then
 | 
			
		||||
        exports.ox_target:addGlobalVehicle({ {
 | 
			
		||||
            icon = 'fa-solid fa-xmark',
 | 
			
		||||
            label = Config.Locales['remove_target'],
 | 
			
		||||
            canInteract = function(entity)
 | 
			
		||||
                return canInteract(entity)
 | 
			
		||||
            end,
 | 
			
		||||
            onSelect = function(data)
 | 
			
		||||
                onSelect(data.entity)
 | 
			
		||||
            end,
 | 
			
		||||
            distance = Config.interactDistance,
 | 
			
		||||
        } })
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if (GetResourceState('qb-target') == 'started') then
 | 
			
		||||
        exports['qb-target']:AddGlobalVehicle({
 | 
			
		||||
            options = {
 | 
			
		||||
                {
 | 
			
		||||
                    icon = 'fa-solid fa-xmark',
 | 
			
		||||
                    label = Config.Locales['remove_target'],
 | 
			
		||||
                    action = function(entity)
 | 
			
		||||
                        onSelect(entity)
 | 
			
		||||
                    end,
 | 
			
		||||
                    canInteract = function(entity)
 | 
			
		||||
                        return canInteract(entity)
 | 
			
		||||
                    end,
 | 
			
		||||
                },
 | 
			
		||||
            },
 | 
			
		||||
            distance = Config.interactDistance,
 | 
			
		||||
        })
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    print('[ERROR] No target interaction defined. Please implement your own target interaction.')
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.InstallingTrackerSystem = function(entity)
 | 
			
		||||
    -- Called while installing the tracker system.
 | 
			
		||||
    -- For example: Add an animation or progress bar
 | 
			
		||||
 | 
			
		||||
    -- Return 'false' to cancel the installation
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.CreateInstallTarget = function(canInteract, onSelect)
 | 
			
		||||
    if (GetResourceState('ox_target') == 'started') then
 | 
			
		||||
        exports.ox_target:addGlobalVehicle({ {
 | 
			
		||||
            icon = 'fa-solid fa-location-crosshairs',
 | 
			
		||||
            label = Config.Locales['install_target'],
 | 
			
		||||
            distance = Config.interactDistance,
 | 
			
		||||
            items = Config.itemName,
 | 
			
		||||
            canInteract = function(entity)
 | 
			
		||||
                return canInteract(entity)
 | 
			
		||||
            end,
 | 
			
		||||
            onSelect = function(data)
 | 
			
		||||
                onSelect(data.entity)
 | 
			
		||||
            end,
 | 
			
		||||
        } })
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if (GetResourceState('qb-target') == 'started') then
 | 
			
		||||
        exports['qb-target']:AddGlobalVehicle({
 | 
			
		||||
            options = {
 | 
			
		||||
                {
 | 
			
		||||
                    icon = 'fa-solid fa-location-crosshairs',
 | 
			
		||||
                    label = Config.Locales['install_target'],
 | 
			
		||||
                    item = Config.itemName,
 | 
			
		||||
                    action = function(entity)
 | 
			
		||||
                        onSelect(entity)
 | 
			
		||||
                    end,
 | 
			
		||||
                    canInteract = function(entity)
 | 
			
		||||
                        return canInteract(entity)
 | 
			
		||||
                    end,
 | 
			
		||||
                },
 | 
			
		||||
            },
 | 
			
		||||
            distance = Config.interactDistance,
 | 
			
		||||
        })
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    print('[ERROR] No target interaction defined. Please implement your own target interaction.')
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,84 @@
 | 
			
		|||
---@diagnostic disable: undefined-field
 | 
			
		||||
ESX = nil
 | 
			
		||||
QBCore = nil
 | 
			
		||||
 | 
			
		||||
if (GetResourceState('es_extended') == 'started') then
 | 
			
		||||
    ESX = exports['es_extended']:getSharedObject()
 | 
			
		||||
elseif (GetResourceState('qb-core') == 'started') then
 | 
			
		||||
    QBCore = exports['qb-core']:GetCoreObject()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions = {}
 | 
			
		||||
 | 
			
		||||
Functions.HasItem = function(playerId, itemName)
 | 
			
		||||
    if ESX then
 | 
			
		||||
        local xPlayer = ESX.GetPlayerFromId(playerId)
 | 
			
		||||
        return xPlayer.getInventoryItem(itemName).count > 0
 | 
			
		||||
    elseif QBCore then
 | 
			
		||||
        local Player = QBCore.Functions.GetPlayer(playerId)
 | 
			
		||||
        return Player.Functions.GetItemByName(itemName).amount > 0
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.RemoveItem = function(playerId, itemName, amount)
 | 
			
		||||
    if ESX then
 | 
			
		||||
        local xPlayer = ESX.GetPlayerFromId(playerId)
 | 
			
		||||
        xPlayer.removeInventoryItem(itemName, amount)
 | 
			
		||||
    elseif QBCore then
 | 
			
		||||
        local Player = QBCore.Functions.GetPlayer(playerId)
 | 
			
		||||
        Player.Functions.RemoveItem(itemName, amount)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Functions.GetPolicePlayers = function()
 | 
			
		||||
    if not Config.allowedJobs then
 | 
			
		||||
        return { -1 }
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local jobs = {}
 | 
			
		||||
    for jobName, _ in pairs(Config.allowedJobs) do
 | 
			
		||||
        jobs[#jobs + 1] = jobName
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local playerIds = {}
 | 
			
		||||
 | 
			
		||||
    if ESX then
 | 
			
		||||
        local result = ESX.GetExtendedPlayers('job', jobs)
 | 
			
		||||
        for key, xPlayers in pairs(result) do
 | 
			
		||||
            for i = 1, #xPlayers do
 | 
			
		||||
                playerIds[#playerIds + 1] = xPlayers[i].source
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    elseif QBCore then
 | 
			
		||||
        for jobName, _ in pairs(Config.allowedJobs) do
 | 
			
		||||
            local players = QBCore.Functions.GetPlayersOnDuty(jobName)
 | 
			
		||||
            for i = 1, #players do
 | 
			
		||||
                playerIds[#playerIds + 1] = players[i]
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return playerIds
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--[[
 | 
			
		||||
-- If you are using an older version of ESX, and the blips are not showing up, you can use this function instead of the one above.
 | 
			
		||||
Functions.GetPolicePlayers = function()
 | 
			
		||||
    local jobs = {}
 | 
			
		||||
    for jobName, _ in pairs(Config.allowedJobs) do
 | 
			
		||||
        jobs[#jobs + 1] = jobName
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local playerIds = {}
 | 
			
		||||
 | 
			
		||||
    for i = 1, #jobs do
 | 
			
		||||
        local jobName = jobs[i]
 | 
			
		||||
        local result = ESX.GetExtendedPlayers('job', jobName)
 | 
			
		||||
        for key, xPlayer in pairs(result) do
 | 
			
		||||
            playerIds[#playerIds + 1] = xPlayer.source
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return playerIds
 | 
			
		||||
end
 | 
			
		||||
]]
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/client/cl_functions.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/client/cl_functions.lua
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/client/cl_main.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/client/cl_main.lua
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										96
									
								
								resources/[jobs]/[police]/gs_trackerdart/config.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								resources/[jobs]/[police]/gs_trackerdart/config.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,96 @@
 | 
			
		|||
Config = {
 | 
			
		||||
    debug = false,
 | 
			
		||||
    dartModel = `trackerdart`,
 | 
			
		||||
    fireCooldown = 3000,   -- Time in milliseconds between each dart shot
 | 
			
		||||
 | 
			
		||||
    singeDart = true,      -- If enabled, only one dart can be deployed at a time. As a result, this will also create a blip route to the target.
 | 
			
		||||
    destroyOldDart = true, -- If enabled, the old dart will be destroyed when a new one is deployed. (Must have singleDart on true)
 | 
			
		||||
 | 
			
		||||
    shootKey = 22,         -- Key used to shoot the dart (Default 22 / Spacebar)
 | 
			
		||||
    disabledControls = {   -- Controls that are disabled when the overlay is open
 | 
			
		||||
        22, 76
 | 
			
		||||
    },
 | 
			
		||||
    overlayKey = 58,      -- Key used to open the overlay (Default 58 / G)
 | 
			
		||||
    toggleOverlay = true, -- If set to true, the overlay will be toggled on/off when the key is pressed instead of holding it down
 | 
			
		||||
    overlayPosition = {
 | 
			
		||||
        vertical = '2.5%',
 | 
			
		||||
        horizontal = '50%',
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    allowedJobs = { -- Jobs that are allowed to install and/or use the tracker system. Set to nil to disable job restrictions.
 | 
			
		||||
        ['police'] = 0,
 | 
			
		||||
        ['sheriff'] = 0
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    installWithTarget = false,  -- If set to true, it requires the player to install the tracker system using a target system and an item before it can be used
 | 
			
		||||
    itemName = 'trackersystem', -- The name of the item used to install the tracker system (If you don't want to use an item, set this to nil)
 | 
			
		||||
    removeItem = true,          -- If set to true, the item will be removed from the player's inventory when the tracker system is installed
 | 
			
		||||
    onlyAllowedVehicles = true, -- If set to true, only vehicles that are in the allowedVehicles list can have the tracker system installed
 | 
			
		||||
    dartsPerVehicle = 5,        -- The amount of darts a vehicle can 'carry'
 | 
			
		||||
 | 
			
		||||
    selfDestructTime = 900,     -- Time in seconds before a tracker dart self destructs (Default: 900 sec / 15 minutes)
 | 
			
		||||
 | 
			
		||||
    interactDistance = 3.0,     -- The distance for the target interactions
 | 
			
		||||
 | 
			
		||||
    blipUpdateInterval = 2000,  -- The interval in milliseconds to update the blips from server to clients
 | 
			
		||||
 | 
			
		||||
    vehicleBlip = {
 | 
			
		||||
        sprite = 225,
 | 
			
		||||
        scale = 0.8,
 | 
			
		||||
        color = 1,
 | 
			
		||||
        shortRange = false,
 | 
			
		||||
        label = 'Tracker Dart',
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    shootPtfx = {
 | 
			
		||||
        dict = 'core',
 | 
			
		||||
        name = 'bul_glass_shotgun',
 | 
			
		||||
        rot = vector3(-90.0, 0.0, 0.0),
 | 
			
		||||
        scale = 1.5,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    explodePtfx = {
 | 
			
		||||
        dict = 'core',
 | 
			
		||||
        name = 'ent_brk_sparking_wires',
 | 
			
		||||
        rot = vector3(0.0, 0.0, 0.0),
 | 
			
		||||
        scale = 1.5,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    removeAnim = {
 | 
			
		||||
        dict = 'mp_arresting',
 | 
			
		||||
        anim = 'a_uncuff',
 | 
			
		||||
        flag = 51,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    allowedVehicles = {
 | 
			
		||||
        [`police`] = 5, -- Override the default amount of darts a vehicle model can carry
 | 
			
		||||
        [`polgauntlet`] = 5,
 | 
			
		||||
        [`police2`] = 5,
 | 
			
		||||
        [`police3`] = 5,
 | 
			
		||||
        [`police4`] = 5,
 | 
			
		||||
        [`police5`] = 5,
 | 
			
		||||
        [`policet`] = 5,
 | 
			
		||||
        [`sheriff`] = 5,
 | 
			
		||||
        [`sheriff2`] = 5,
 | 
			
		||||
        [`fbi`] = 5,
 | 
			
		||||
        [`fbi2`] = 5,
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Config.Locales = {
 | 
			
		||||
    ['target_missed'] = 'You missed the target',
 | 
			
		||||
    ['install_system'] = 'You need to install the tracker system first',
 | 
			
		||||
    ['no_darts_left'] = 'You do not have any darts left',
 | 
			
		||||
    ['target_has_dart'] = 'There is already a dart on the target',
 | 
			
		||||
    ['dart_attached'] = 'You have attached a dart to the target',
 | 
			
		||||
    ['already_installed'] = 'This vehicle already has a tracker system installed',
 | 
			
		||||
    ['dart_system_installed'] = 'You have installed the tracker system on this vehicle',
 | 
			
		||||
    ['not_allowed_vehicle'] = 'You cannot install the tracker system on this vehicle',
 | 
			
		||||
    ['remove_target'] = 'Remove tracker dart',
 | 
			
		||||
    ['failed_remove_dart'] = 'Failed to remove tracker dart',
 | 
			
		||||
    ['removed_dart'] = 'You have removed the tracker dart',
 | 
			
		||||
    ['only_one_dart'] = 'You can only deploy one dart at a time',
 | 
			
		||||
    ['old_dart_destroyed'] = 'The old dart has been destroyed',
 | 
			
		||||
    ['no_item'] = 'You do not have the item',
 | 
			
		||||
    ['install_target'] = 'Install tracker system',
 | 
			
		||||
}
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -0,0 +1,109 @@
 | 
			
		|||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<Dat54>
 | 
			
		||||
    <Version value="7314721" />
 | 
			
		||||
    <ContainerPaths>
 | 
			
		||||
        <Item>audiodirectory\custom_sounds</Item>
 | 
			
		||||
    </ContainerPaths>
 | 
			
		||||
    <Items>
 | 
			
		||||
        <!-- SimpleSounds -->
 | 
			
		||||
        <Item type="SimpleSound">
 | 
			
		||||
            <Name>dartshoot_01_sp</Name>
 | 
			
		||||
            <Header>
 | 
			
		||||
                <Flags value="0x00008004" />
 | 
			
		||||
                <Volume value="200" />
 | 
			
		||||
                <Category>scripted</Category>
 | 
			
		||||
            </Header>
 | 
			
		||||
            <ContainerName>audiodirectory/custom_sounds</ContainerName>
 | 
			
		||||
            <FileName>shoot01</FileName>
 | 
			
		||||
            <WaveSlotNum value="0" />
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item type="SimpleSound">
 | 
			
		||||
            <Name>dartshoot_02_sp</Name>
 | 
			
		||||
            <Header>
 | 
			
		||||
                <Flags value="0x00008004" />
 | 
			
		||||
                <Volume value="200" />
 | 
			
		||||
                <Category>scripted</Category>
 | 
			
		||||
            </Header>
 | 
			
		||||
            <ContainerName>audiodirectory/custom_sounds</ContainerName>
 | 
			
		||||
            <FileName>shoot02</FileName>
 | 
			
		||||
            <WaveSlotNum value="0" />
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item type="SimpleSound">
 | 
			
		||||
            <Name>dartshoot_03_sp</Name>
 | 
			
		||||
            <Header>
 | 
			
		||||
                <Flags value="0x00008004" />
 | 
			
		||||
                <Volume value="200" />
 | 
			
		||||
                <Category>scripted</Category>
 | 
			
		||||
            </Header>
 | 
			
		||||
            <ContainerName>audiodirectory/custom_sounds</ContainerName>
 | 
			
		||||
            <FileName>shoot03</FileName>
 | 
			
		||||
            <WaveSlotNum value="0" />
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item type="SimpleSound">
 | 
			
		||||
            <Name>dartshoot_04_sp</Name>
 | 
			
		||||
            <Header>
 | 
			
		||||
                <Flags value="0x00008004" />
 | 
			
		||||
                <Volume value="200" />
 | 
			
		||||
                <Category>scripted</Category>
 | 
			
		||||
            </Header>
 | 
			
		||||
            <ContainerName>audiodirectory/custom_sounds</ContainerName>
 | 
			
		||||
            <FileName>shoot04</FileName>
 | 
			
		||||
            <WaveSlotNum value="0" />
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item type="SimpleSound">
 | 
			
		||||
            <Name>dartshoot_05_sp</Name>
 | 
			
		||||
            <Header>
 | 
			
		||||
                <Flags value="0x00008004" />
 | 
			
		||||
                <Volume value="200" />
 | 
			
		||||
                <Category>scripted</Category>
 | 
			
		||||
            </Header>
 | 
			
		||||
            <ContainerName>audiodirectory/custom_sounds</ContainerName>
 | 
			
		||||
            <FileName>shoot05</FileName>
 | 
			
		||||
            <WaveSlotNum value="0" />
 | 
			
		||||
        </Item>
 | 
			
		||||
        <Item type="SimpleSound">
 | 
			
		||||
            <Name>dartshoot_06_sp</Name>
 | 
			
		||||
            <Header>
 | 
			
		||||
                <Flags value="0x00008004" />
 | 
			
		||||
                <Volume value="200" />
 | 
			
		||||
                <Category>scripted</Category>
 | 
			
		||||
            </Header>
 | 
			
		||||
            <ContainerName>audiodirectory/custom_sounds</ContainerName>
 | 
			
		||||
            <FileName>shoot06</FileName>
 | 
			
		||||
            <WaveSlotNum value="0" />
 | 
			
		||||
        </Item>
 | 
			
		||||
        <!-- SoundSets -->
 | 
			
		||||
        <Item type="SoundSet">
 | 
			
		||||
            <Name>trackerdart_soundset</Name>
 | 
			
		||||
            <Header>
 | 
			
		||||
                <Flags value="0xAAAAAAAA" />
 | 
			
		||||
            </Header>
 | 
			
		||||
            <SoundSets>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <ScriptName>dartshoot01</ScriptName>
 | 
			
		||||
                    <ChildSound>dartshoot_01_sp</ChildSound>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <ScriptName>dartshoot02</ScriptName>
 | 
			
		||||
                    <ChildSound>dartshoot_02_sp</ChildSound>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <ScriptName>dartshoot03</ScriptName>
 | 
			
		||||
                    <ChildSound>dartshoot_03_sp</ChildSound>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <ScriptName>dartshoot04</ScriptName>
 | 
			
		||||
                    <ChildSound>dartshoot_04_sp</ChildSound>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <ScriptName>dartshoot05</ScriptName>
 | 
			
		||||
                    <ChildSound>dartshoot_05_sp</ChildSound>
 | 
			
		||||
                </Item>
 | 
			
		||||
                <Item>
 | 
			
		||||
                    <ScriptName>dartshoot06</ScriptName>
 | 
			
		||||
                    <ChildSound>dartshoot_06_sp</ChildSound>
 | 
			
		||||
                </Item>
 | 
			
		||||
            </SoundSets>
 | 
			
		||||
        </Item>
 | 
			
		||||
    </Items>
 | 
			
		||||
</Dat54>
 | 
			
		||||
							
								
								
									
										47
									
								
								resources/[jobs]/[police]/gs_trackerdart/fxmanifest.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								resources/[jobs]/[police]/gs_trackerdart/fxmanifest.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,47 @@
 | 
			
		|||
fx_version 'cerulean'
 | 
			
		||||
games { 'gta5' }
 | 
			
		||||
 | 
			
		||||
author 'Gamzky'
 | 
			
		||||
description 'Police Tracker Dart System'
 | 
			
		||||
version '1.0.5'
 | 
			
		||||
 | 
			
		||||
ui_page 'ui/index.html'
 | 
			
		||||
 | 
			
		||||
lua54 'yes'
 | 
			
		||||
 | 
			
		||||
shared_scripts {
 | 
			
		||||
    '@ox_lib/init.lua',
 | 
			
		||||
    'config.lua',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
client_scripts {
 | 
			
		||||
    'bridge/cl_bridge.lua',
 | 
			
		||||
    'client/cl_functions.lua',
 | 
			
		||||
    'client/cl_main.lua',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
server_scripts {
 | 
			
		||||
    'bridge/sv_bridge.lua',
 | 
			
		||||
    'server/sv_main.lua',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
escrow_ignore {
 | 
			
		||||
    'audiodirectory/*',
 | 
			
		||||
    'bridge/*.lua',
 | 
			
		||||
    'data/*',
 | 
			
		||||
    'stream/*',
 | 
			
		||||
    'config.lua',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
files {
 | 
			
		||||
    'ui/index.html',
 | 
			
		||||
    'data/audioexample_sounds.dat54.rel',
 | 
			
		||||
    'audiodirectory/custom_sounds.awc',
 | 
			
		||||
    'stream/trackerdart.ytyp',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
data_file 'AUDIO_WAVEPACK' 'audiodirectory'
 | 
			
		||||
data_file 'AUDIO_SOUNDDATA' 'data/audioexample_sounds.dat'
 | 
			
		||||
data_file 'DLC_ITYP_REQUEST' 'stream/trackerdart.ytyp'
 | 
			
		||||
 | 
			
		||||
dependency '/assetpacks'
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/server/sv_main.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/server/sv_main.lua
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/stream/trackerdart.ydr
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/stream/trackerdart.ydr
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/stream/trackerdart.ytyp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								resources/[jobs]/[police]/gs_trackerdart/stream/trackerdart.ytyp
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										121
									
								
								resources/[jobs]/[police]/gs_trackerdart/ui/index.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										121
									
								
								resources/[jobs]/[police]/gs_trackerdart/ui/index.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,121 @@
 | 
			
		|||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
    <head>
 | 
			
		||||
        <meta charset="UTF-8" />
 | 
			
		||||
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
 | 
			
		||||
        <title>Tracker Dart</title>
 | 
			
		||||
        <style>
 | 
			
		||||
            body {
 | 
			
		||||
                margin: 0;
 | 
			
		||||
                padding: 0;
 | 
			
		||||
                background: transparent;
 | 
			
		||||
                font-family: 'Orbitron', sans-serif;
 | 
			
		||||
                overflow: hidden;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .hud-container {
 | 
			
		||||
                position: fixed;
 | 
			
		||||
                bottom: 20px;
 | 
			
		||||
                left: 50%;
 | 
			
		||||
                transform: translateX(-50%);
 | 
			
		||||
                background: linear-gradient(135deg, #111, #333);
 | 
			
		||||
                border: 2px solid #333;
 | 
			
		||||
                border-radius: 12px;
 | 
			
		||||
                padding: 15px 30px;
 | 
			
		||||
                display: flex;
 | 
			
		||||
                flex-direction: column;
 | 
			
		||||
                align-items: center;
 | 
			
		||||
                color: white;
 | 
			
		||||
                box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
 | 
			
		||||
                opacity: 0;
 | 
			
		||||
                transition: opacity 0.3s;
 | 
			
		||||
                pointer-events: none;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .target-status {
 | 
			
		||||
                font-size: 24px;
 | 
			
		||||
                font-weight: bold;
 | 
			
		||||
                margin-bottom: 10px;
 | 
			
		||||
                transition: color 0.3s, text-shadow 0.3s;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .target-status.active {
 | 
			
		||||
                color: #00ff00;
 | 
			
		||||
                text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .target-status.inactive {
 | 
			
		||||
                color: #ff0000;
 | 
			
		||||
                text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            .darts-left {
 | 
			
		||||
                font-size: 18px;
 | 
			
		||||
                font-weight: 600;
 | 
			
		||||
            }
 | 
			
		||||
        </style>
 | 
			
		||||
        <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap" rel="stylesheet" />
 | 
			
		||||
    </head>
 | 
			
		||||
    <body>
 | 
			
		||||
        <div class="hud-container">
 | 
			
		||||
            <div id="targetStatus" class="target-status inactive">TARGET</div>
 | 
			
		||||
            <div id="dartsLeft" class="darts-left">Darts Left: 5</div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <script>
 | 
			
		||||
            window.addEventListener('message', (event) => {
 | 
			
		||||
                const action = event.data.action;
 | 
			
		||||
                switch (action) {
 | 
			
		||||
                    case 'setOverlayStatus':
 | 
			
		||||
                        toggleOverlay(event.data.active, event.data.options);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case 'setTargetStatus':
 | 
			
		||||
                        updateTargetStatus(event.data.active);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case 'setDartsLeft':
 | 
			
		||||
                        updateDartsLeft(event.data.count);
 | 
			
		||||
                        break;
 | 
			
		||||
                    default:
 | 
			
		||||
                        console.log(`Unknown action: ${action}`);
 | 
			
		||||
                        break;
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            const toggleOverlay = (open, options = {}) => {
 | 
			
		||||
                const overlay = document.querySelector('.hud-container');
 | 
			
		||||
                if (open) {
 | 
			
		||||
                    overlay.style.opacity = 1;
 | 
			
		||||
                    overlay.style.pointerEvents = 'auto';
 | 
			
		||||
 | 
			
		||||
                    overlay.style.bottom = options?.vertical ?? '20px';
 | 
			
		||||
                    overlay.style.left = options?.horizontal ?? '50%';
 | 
			
		||||
                } else {
 | 
			
		||||
                    overlay.style.opacity = 0;
 | 
			
		||||
                    overlay.style.pointerEvents = 'none';
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            let dartsLeft = 0;
 | 
			
		||||
            let hasTarget = false;
 | 
			
		||||
 | 
			
		||||
            const targetStatusElement = document.getElementById('targetStatus');
 | 
			
		||||
            const dartsLeftElement = document.getElementById('dartsLeft');
 | 
			
		||||
 | 
			
		||||
            const updateTargetStatus = (active) => {
 | 
			
		||||
                hasTarget = active;
 | 
			
		||||
                if (hasTarget) {
 | 
			
		||||
                    targetStatusElement.textContent = 'TARGET';
 | 
			
		||||
                    targetStatusElement.className = 'target-status active';
 | 
			
		||||
                } else {
 | 
			
		||||
                    targetStatusElement.textContent = 'TARGET';
 | 
			
		||||
                    targetStatusElement.className = 'target-status inactive';
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            const updateDartsLeft = (count) => {
 | 
			
		||||
                dartsLeft = count;
 | 
			
		||||
                dartsLeftElement.textContent = `Darts Left: ${dartsLeft}`;
 | 
			
		||||
            };
 | 
			
		||||
        </script>
 | 
			
		||||
    </body>
 | 
			
		||||
</html>
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue