mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f09e34b1b5 | ||
|
|
1146639d6f | ||
|
|
a9ac2e8897 | ||
|
|
1a1960f5a8 | ||
|
|
996b135973 | ||
|
|
9337238832 | ||
|
|
ee049a953c | ||
|
|
adfe3e8e08 | ||
|
|
71c9c99db7 | ||
|
|
dd66083f45 | ||
|
|
9ddd6422bd | ||
|
|
7d24c274cd | ||
|
|
3911824fc6 | ||
|
|
9729d2fef1 | ||
|
|
3cb4005889 | ||
|
|
bf759ebaf8 | ||
|
|
3d0eb3df65 | ||
|
|
fe09d0f773 |
12
.github/workflows/notify-discord.yml
vendored
12
.github/workflows/notify-discord.yml
vendored
@@ -8,10 +8,10 @@ on:
|
||||
jobs:
|
||||
notify:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Discord Commits
|
||||
uses: Sniddl/discord-commits@v1.6
|
||||
with:
|
||||
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
template: "avatar-with-link"
|
||||
include-extras: true
|
||||
- name: Send commit payload to Discord Bot
|
||||
run: |
|
||||
curl -X POST http://${{ secrets.DISCORDBOT }}:3000/github-commits \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '${{ toJson(github.event) }}'
|
||||
@@ -376,7 +376,10 @@ for script, data in pairs(invWeightTable) do
|
||||
if checkExists(script) then
|
||||
if script == Exports.QBInv and GetResourceState(Exports.JPRInv):find("start") then goto skip end
|
||||
|
||||
while GetResourceState(script) ~= "started" do Wait(100) print("Waiting for script start") end
|
||||
while GetResourceState(script) ~= "started" and GetResourceState(script) ~= "stopped" do
|
||||
Wait(100)
|
||||
print("Waiting for script start")
|
||||
end
|
||||
local attempts = data.fallback or { data }
|
||||
local lookup, used, err
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name "Jim_Bridge"
|
||||
author "Jimathy"
|
||||
version "2.0.21"
|
||||
version "2.0.22"
|
||||
description "Framework Bridge By Jimathy"
|
||||
fx_version "cerulean"
|
||||
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
|
||||
|
||||
@@ -117,7 +117,7 @@ function onResourceStart(func, thisScript)
|
||||
debugPrint("^6Bridge^7: ^2Shared Load Detected^7.")
|
||||
hasPrinted = true
|
||||
end
|
||||
func()
|
||||
func(resourceName)
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -136,7 +136,7 @@ function onResourceStop(func, thisScript)
|
||||
debugPrint("^6Bridge^7: ^2Registering ^3onResourceStop^7()")
|
||||
AddEventHandler('onResourceStop', function(resourceName)
|
||||
if getScript() == resourceName and (thisScript or true) then
|
||||
func()
|
||||
func(resourceName)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ function drawText(image, input, style, oxStyleTable)
|
||||
keybind = nil,
|
||||
icon = (image and radarTable[image] or image) or nil,
|
||||
iconColor = '#3B82F6',
|
||||
position = 'center-left'
|
||||
position = 'left-center'
|
||||
})
|
||||
|
||||
elseif Config.System.drawText == "gta" then
|
||||
|
||||
@@ -111,7 +111,7 @@ function getPlayerInv(src)
|
||||
if src then
|
||||
grabInv = exports[OrigenInv]:getInventory(src)
|
||||
else
|
||||
grabInv = exports[OrigenInv]:getInventory()
|
||||
grabInv = exports[OrigenInv]:GetInventory()
|
||||
end
|
||||
|
||||
elseif isStarted(CoreInv) then
|
||||
@@ -232,6 +232,7 @@ function invImg(item)
|
||||
|
||||
elseif isStarted(PSInv) then
|
||||
imgLink = "nui://"..PSInv.."/html/images/"..(Items[item].image or "")
|
||||
|
||||
elseif isStarted(TgiannInv) then
|
||||
imgLink = "nui://inventory_images/images/"..(Items[item].image or "")
|
||||
|
||||
|
||||
@@ -133,16 +133,19 @@ function makeEntityBlip(data)
|
||||
AddTextComponentString(tostring(data.name))
|
||||
EndTextCommandSetBlipName(blip)
|
||||
-- Handle preview image if certain resources are running
|
||||
if isStarted("fs_smallresources") or isStarted("blip-info") or isStarted("blipinfo") then
|
||||
if isStarted("jim-blipcontroller") then
|
||||
if data.preview then
|
||||
local txname = string.gsub(tostring(data.name..'preview'), "[ ()~]", "")
|
||||
local txname = string.gsub(tostring(data.name..'preview'..string.gsub(data.coords.z, "%.", "")), "[ ()~]", "")
|
||||
if data.preview:find("http") or data.preview:find("nui") then
|
||||
createDui(txname, data.preview, vec2(512, 256), scriptTxd)
|
||||
else
|
||||
CreateRuntimeTextureFromImage(scriptTxd, txname, data.preview)
|
||||
end
|
||||
exports["fs_smallresources"]:SetBlipInfoImage(blip, getScript()..'previewTxd', txname)
|
||||
exports["fs_smallresources"]:SetBlipInfoTitle(blip, data.name, false)
|
||||
exports["jim-blipcontroller"]:ShowBlipInfo(blip, {
|
||||
title = data.name,
|
||||
dict = getScript()..'scriptTxd',
|
||||
tex = txname,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -55,7 +55,7 @@ end
|
||||
-- ```lua
|
||||
-- local ped = makePed(pedData, pedCoords, true, false, nil, {'animDict', 'animName'}, true)
|
||||
-- ```
|
||||
function makePed(data, coords, freeze, collision, scenario, anim, synced)
|
||||
function makePed(data, coords, freeze, collision, scenario, anim, synced, fade)
|
||||
local ped = nil
|
||||
local model = nil
|
||||
if type(data) == "table" then
|
||||
@@ -142,10 +142,11 @@ function makePed(data, coords, freeze, collision, scenario, anim, synced)
|
||||
end
|
||||
unloadModel(model)
|
||||
Peds[keyGen()..keyGen()] = ped
|
||||
|
||||
CreateThread(function()
|
||||
fadeInEnt(ped)
|
||||
end)
|
||||
if fade ~= false then
|
||||
CreateThread(function()
|
||||
fadeInEnt(ped)
|
||||
end)
|
||||
end
|
||||
return ped
|
||||
end
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ local Props = {}
|
||||
--- }
|
||||
--- local prop = makeProp(propData, true, false)
|
||||
--- ```
|
||||
function makeProp(data, freeze, synced)
|
||||
function makeProp(data, freeze, synced, fade)
|
||||
loadModel(data.prop)
|
||||
local prop = CreateObject(data.prop, data.coords.x, data.coords.y, data.coords.z-1.03, synced and synced or false, synced and synced or false, false)
|
||||
SetEntityAlpha(veh, 0, false)
|
||||
@@ -30,9 +30,11 @@ function makeProp(data, freeze, synced)
|
||||
debugPrint("^6Bridge^7: ^1Prop ^2Created^7: '^6"..prop.."^7' | ^2Hash^7: ^7'^6"..data.prop.."^7' | ^2Coord^7: "..formatCoord(data.coords))
|
||||
SetModelAsNoLongerNeeded(data.prop)
|
||||
Props[keyGen()..keyGen()] = prop
|
||||
CreateThread(function()
|
||||
fadeInEnt(prop)
|
||||
end)
|
||||
if fade ~= false then
|
||||
CreateThread(function()
|
||||
fadeInEnt(prop)
|
||||
end)
|
||||
end
|
||||
return prop
|
||||
end
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ local Vehicles = {}
|
||||
--- ```lua
|
||||
--- local vehicle = makeVeh('adder', vector4(123.4, 567.8, 90.1, 180.0))
|
||||
--- ```
|
||||
function makeVeh(model, coords)
|
||||
function makeVeh(model, coords, synced, fade)
|
||||
loadModel(model)
|
||||
local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w, true, false)
|
||||
local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w, synced ~= false, false)
|
||||
SetVehicleHasBeenOwnedByPlayer(veh, true)
|
||||
if gameName ~= "rdr3" then
|
||||
SetEntityAlpha(veh, 0, false)
|
||||
@@ -31,9 +31,11 @@ function makeVeh(model, coords)
|
||||
debugPrint("^6Bridge^7: ^1Veh ^2Created^7: '^6"..veh.."^7' | ^2Hash^7: ^7'^6"..model.."^7' | ^2Coord^7: "..formatCoord(coords))
|
||||
unloadModel(model)
|
||||
Vehicles[#Vehicles + 1] = veh
|
||||
CreateThread(function()
|
||||
fadeInEnt(veh)
|
||||
end)
|
||||
if fade ~= false then
|
||||
CreateThread(function()
|
||||
fadeInEnt(veh)
|
||||
end)
|
||||
end
|
||||
return veh
|
||||
end
|
||||
|
||||
@@ -56,7 +58,7 @@ function makeDistVehicle(data, radius, onEnter, onExit)
|
||||
coords = vec3(data.coords.x, data.coords.y, data.coords.z),
|
||||
radius = radius,
|
||||
onEnter = function()
|
||||
vehicle = makeVeh(data.model, data.coords)
|
||||
vehicle = makeVeh(data.model, data.coords, false)
|
||||
if onEnter then
|
||||
debugPrint("^6Bridge^7: ^4makeDistVehicle ^3onEnter^7() ^2running^7")
|
||||
onEnter(vehicle)
|
||||
|
||||
@@ -119,6 +119,27 @@ function progressBar(data)
|
||||
result = false
|
||||
end, data.icon)
|
||||
|
||||
elseif Config.System.ProgressBar == "qs" then -- documentation left intact based on qs interface
|
||||
local qs_success = exports['qs-interface']:ProgressBar({
|
||||
duration = debugMode and 1000 or data.time, -- Duration of the progress bar (in milliseconds)
|
||||
label = data.label, -- Text that will appear on the progress bar
|
||||
position = 'bottom', -- Position of the progress bar on the screen (e.g., 'top', 'bottom', 'center')
|
||||
useWhileDead = data.dead or false, -- Whether the progress bar shows when the player is dead (true/false)
|
||||
canCancel = data.cancel or true, -- Whether the player can cancel the progress (true/false)
|
||||
disable = data.disableMovement or false, -- Whether to disable player controls during the progress (true/false)
|
||||
anim = { -- Animation to be played while the progress is happening
|
||||
dict = data.dict,
|
||||
clip = data.anim,
|
||||
flag = data.flag or 32 -- Optional animation flags
|
||||
},
|
||||
prop = nil -- Optional prop to show alongside the progress bar (can be nil)
|
||||
})
|
||||
if qs_success then
|
||||
result = true
|
||||
else
|
||||
result = false
|
||||
end
|
||||
|
||||
elseif Config.System.ProgressBar == "esx" then
|
||||
ESX.Progressbar(data.label, debugMode and 1000 or data.time, {
|
||||
FreezePlayer = true,
|
||||
|
||||
@@ -44,6 +44,12 @@ function triggerNotify(title, message, type, src)
|
||||
else
|
||||
TriggerClientEvent("QBCore:Notify", src, message, type)
|
||||
end
|
||||
elseif Config.System.Notify == "qs" then
|
||||
if not src then
|
||||
exports['qs-interface']:AddNotify(message, title, 6000)
|
||||
else
|
||||
TriggerClientEvent('interface:notification', src, message, title, 6000)
|
||||
end
|
||||
elseif Config.System.Notify == "ox" then
|
||||
if not src then
|
||||
TriggerEvent('ox_lib:notify', { title = title, description = message, type = type or "success" })
|
||||
|
||||
@@ -171,7 +171,7 @@ function sendPhoneInvoice(data)
|
||||
end
|
||||
},
|
||||
{
|
||||
name = "gks-phone",
|
||||
name = "gksphone",
|
||||
send = function(mailData)
|
||||
-- Defensive check for required fields
|
||||
local required = { "billedCitizenid", "amount", "job", "name", "billerCitizenid", "label" }
|
||||
@@ -197,7 +197,6 @@ function sendPhoneInvoice(data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Check each phone system in order and use the first active one.
|
||||
for _, phone in ipairs(phoneSystems) do
|
||||
if isStarted(phone.name) then
|
||||
|
||||
@@ -44,19 +44,34 @@ function createPoly(data)
|
||||
local Location = nil
|
||||
if isStarted(OXLibExport) then
|
||||
debugPrint("^6Bridge^7: ^2Creating new poly with ^7'^4"..OXLibExport.."^7': "..data.name)
|
||||
-- Convert 2D points to 3D with a fixed Z coordinate (e.g., 12.0)
|
||||
|
||||
data.minZ = data.minZ or 12.0
|
||||
data.maxZ = data.maxZ or 1000.0
|
||||
data.thickness = ((data.maxZ / 2) - (data.minZ / 2)) * 2
|
||||
|
||||
local mid = data.maxZ - ((data.maxZ / 2) - (data.minZ / 2))
|
||||
for i = 1, #data.points do
|
||||
data.points[i] = vec3(data.points[i].x, data.points[i].y, 12.0)
|
||||
data.points[i] = vec3(data.points[i].x, data.points[i].y, mid)
|
||||
end
|
||||
data.thickness = 1000 -- Set a default thickness value
|
||||
|
||||
Location = lib.zones.poly(data)
|
||||
|
||||
elseif isStarted("PolyZone") then
|
||||
debugPrint("^6Bridge^7: ^2Creating new poly with ^7'^4PolyZone^7': "..data.name)
|
||||
Location = PolyZone:Create(data.points, { name = data.name, debugPoly = data.debug })
|
||||
Location = PolyZone:Create(data.points, {
|
||||
name = data.name,
|
||||
minZ = data.minZ or nil,
|
||||
maxZ = data.maxZ or nil,
|
||||
debugPoly = data.debug
|
||||
})
|
||||
Location:onPlayerInOut(function(isPointInside)
|
||||
if isPointInside then data.onEnter() else data.onExit() end
|
||||
|
||||
if isPointInside then
|
||||
data.onEnter()
|
||||
else
|
||||
data.onExit()
|
||||
end
|
||||
end)
|
||||
|
||||
else
|
||||
print("^4ERROR^7: ^2No PolyZone creation script detected ^7- ^2Check ^3exports^1.^2lua^7")
|
||||
end
|
||||
|
||||
@@ -261,6 +261,6 @@ function registerShop(name, label, items, society)
|
||||
if shopResource ~= "" then
|
||||
debugPrint("^6Bridge^7: ^2Registering ^5"..shopResource.." ^3Store^7:", name, "^4Label^7: "..label)
|
||||
else
|
||||
debugPrint("^1ERROR^7: ^1Couldn't find supported inventory to register shop^7:", name)
|
||||
-- debugPrint("^1ERROR^7: ^1Couldn't find supported inventory to register shop^7:", name)
|
||||
end
|
||||
end
|
||||
@@ -469,7 +469,7 @@ function stashRemoveItem(stashItems, stashName, items)
|
||||
end
|
||||
end
|
||||
exports[CodeMInv]:UpdateStash(stashName[1], stashItems)
|
||||
debugPrint("^6Bridge^7: ^3saveStash^7: ^2Saving ^3CodeM^2 stash ^7'^6"..stashName.."^7'")
|
||||
debugPrint("^6Bridge^7: ^3saveStash^7: ^2Saving ^3CodeM^2 stash ^7'^6"..stashName[1].."^7'")
|
||||
|
||||
elseif isStarted(OrigenInv) then
|
||||
for k, v in pairs(items) do
|
||||
|
||||
@@ -158,19 +158,25 @@ function createBoxTarget(data, opts, dist)
|
||||
icon = opts[i].icon,
|
||||
label = opts[i].label,
|
||||
items = opts[i].item or nil,
|
||||
groups = opts[i].job or opts[i].gang,
|
||||
groups = opts[i].groups or opts[i].job or opts[i].gang,
|
||||
onSelect = opts[i].onSelect or opts[i].action,
|
||||
distance = dist,
|
||||
canInteract = opts[i].canInteract or nil,
|
||||
}
|
||||
end
|
||||
if not data[5].useZ then
|
||||
local z = data[2].z + math.abs(data[5].maxZ - data[5].minZ) / 2
|
||||
data[2] = vec3(data[2].x, data[2].y, z)
|
||||
end
|
||||
|
||||
data[5].maxZ = data[5].maxZ or (data[2].z + 0.80)
|
||||
data[5].minZ = data[5].minZ or data[2].z - 1.05
|
||||
local thickness = ((data[5].maxZ / 2) - (data[5].minZ / 2)) * 2
|
||||
local mid = data[5].maxZ - ((data[5].maxZ / 2) - (data[5].minZ / 2))
|
||||
|
||||
--if not data[5].useZ then
|
||||
-- local z = data[2].z + math.abs(data[5].maxZ - data[5].minZ) / 2
|
||||
data[2] = vec3(data[2].x, data[2].y, mid) -- force the coord to middle of the minZ and maxZ
|
||||
--end
|
||||
local target = exports[OXTargetExport]:addBoxZone({
|
||||
coords = data[2],
|
||||
size = vec3(data[4], data[3], (data[5].useZ or not data[5].maxZ) and data[2].z or math.abs(data[5].maxZ - data[5].minZ)),
|
||||
size = vec3(data[4], data[3], thickness), -- size uses the math to determine how high it needs to be
|
||||
rotation = data[5].heading,
|
||||
debug = data[5].debugPoly,
|
||||
options = options
|
||||
|
||||
@@ -53,7 +53,7 @@ function gtaSkillCheck()
|
||||
DrawRect(x - width / 2 + (highlightStart + highlightSize / 2) * width, y, highlightSize * width, height+0.001, 228, 52, 52, 255)
|
||||
DrawRect(x - width / 2 + cursorPos * width, y, 0.002, height + 0.01, 255, 255, 255, 255)
|
||||
|
||||
drawSuccessText(x, y, "Failed", 228, 52, 52)
|
||||
drawGTASuccessText(x, y, "Failed", 228, 52, 52)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
23
version.txt
23
version.txt
@@ -1,14 +1,15 @@
|
||||
2.0.21
|
||||
2.0.22
|
||||
|
||||
- Fix toggleDuty() for ESX users
|
||||
- Rename metadata handler functions
|
||||
- Add useToolDegrade() to force limited uses for items
|
||||
- Make breakTool() smarter
|
||||
- Fix getPlayer() not checking if player data exists yet on qbcore
|
||||
- Fix inbuilt gta progressbar error when stopping animations
|
||||
- lation_ui support fixes
|
||||
- Add fade in animations for created entities
|
||||
- Fix waitForSharedLoad() not announcing when an error occurs
|
||||
- Incrase authToken timeout from 5 seconds to 1 minute
|
||||
- Support for qs-interface
|
||||
- Fix polyzone minZ + maxZ handling
|
||||
- Fix ox_target zone location to match qb-target
|
||||
- Fix "Waiting for script start" loop bug
|
||||
- Add condition for fading in entities
|
||||
- Fix typo breaking scripts on gta skillbar fail
|
||||
- Fix typo for gksphone invoice event
|
||||
- Fix latio_ui TextUI placement
|
||||
- Remove registerShop debug message
|
||||
- Fix typo in print when removing codem stash item
|
||||
- Fix function typo from origen inv documenation
|
||||
|
||||
https://github.com/jimathy/jim_bridge
|
||||
Reference in New Issue
Block a user