mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9b97b7505 | ||
|
|
489da64c5e | ||
|
|
07c35cd917 | ||
|
|
3f72a21d75 | ||
|
|
4ad6170a49 | ||
|
|
18df0817b1 | ||
|
|
0eca7ae29e | ||
|
|
6a5913230f | ||
|
|
b7a284e051 |
@@ -35,7 +35,14 @@ function CheckBridgeVersion()
|
|||||||
if compareResult == 0 then
|
if compareResult == 0 then
|
||||||
print("^7'^3jim_bridge^7' - ^2You are running the latest version^7. ^7(^3"..currentVersionRaw.."^7)")
|
print("^7'^3jim_bridge^7' - ^2You are running the latest version^7. ^7(^3"..currentVersionRaw.."^7)")
|
||||||
elseif compareResult < 0 then
|
elseif compareResult < 0 then
|
||||||
|
-- Made the check a bit more obvious
|
||||||
|
print("^1----------------------------------------------------------------------^7")
|
||||||
print("^7'^3jim_bridge^7' - ^1You are running an outdated version^7! ^7(^3"..currentVersionRaw.."^7 → ^3"..newestVersionRaw.."^7)")
|
print("^7'^3jim_bridge^7' - ^1You are running an outdated version^7! ^7(^3"..currentVersionRaw.."^7 → ^3"..newestVersionRaw.."^7)")
|
||||||
|
print("^1----------------------------------------------------------------------^7")
|
||||||
|
SetTimeout(1200000, function()
|
||||||
|
-- Do a naughty repeat message every 20 minutes until the the script is updated
|
||||||
|
CheckBridgeVersion()
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
print("^7'^3jim_bridge^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..newestVersionRaw.."^7)")
|
print("^7'^3jim_bridge^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..newestVersionRaw.."^7)")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name "Jim_Bridge"
|
name "Jim_Bridge"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "2.0.04"
|
version "2.0.05"
|
||||||
description "Framework Bridge By Jimathy"
|
description "Framework Bridge By Jimathy"
|
||||||
fx_version "cerulean"
|
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.'
|
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
|
||||||
|
|||||||
@@ -51,7 +51,13 @@ function CheckVersion()
|
|||||||
if compareResult == 0 then
|
if compareResult == 0 then
|
||||||
print("^7'^3"..script.."^7' - ^2You are running the latest version^7. (^3"..currentVersionRaw.."^7)")
|
print("^7'^3"..script.."^7' - ^2You are running the latest version^7. (^3"..currentVersionRaw.."^7)")
|
||||||
elseif compareResult < 0 then
|
elseif compareResult < 0 then
|
||||||
|
print("^1----------------------------------------------------------------------^7")
|
||||||
print("^7'^3"..script.."^7' - ^1You are currently running an outdated version^7! (^3"..currentVersionRaw.."^7 → ^3"..fallbackVersionRaw.."^7)")
|
print("^7'^3"..script.."^7' - ^1You are currently running an outdated version^7! (^3"..currentVersionRaw.."^7 → ^3"..fallbackVersionRaw.."^7)")
|
||||||
|
print("^1----------------------------------------------------------------------^7")
|
||||||
|
SetTimeout(1200000, function()
|
||||||
|
-- Do a naughty repeat message every 20 minutes until the the script is updated
|
||||||
|
CheckVersion()
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
print("^7'^3"..script.."^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..fallbackVersionRaw.."^7)")
|
print("^7'^3"..script.."^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..fallbackVersionRaw.."^7)")
|
||||||
end
|
end
|
||||||
@@ -63,7 +69,13 @@ function CheckVersion()
|
|||||||
if compareResult == 0 then
|
if compareResult == 0 then
|
||||||
print("^7'^3"..script.."^7' - ^2You are running the latest version^7. (^3"..currentVersionRaw.."^7)")
|
print("^7'^3"..script.."^7' - ^2You are running the latest version^7. (^3"..currentVersionRaw.."^7)")
|
||||||
elseif compareResult < 0 then
|
elseif compareResult < 0 then
|
||||||
|
print("^1----------------------------------------------------------------------^7")
|
||||||
print("^7'^3"..script.."^7' - ^1You are currently running an outdated version^7! (^3"..currentVersionRaw.."^7 → ^3"..newestVersionRaw.."^7)")
|
print("^7'^3"..script.."^7' - ^1You are currently running an outdated version^7! (^3"..currentVersionRaw.."^7 → ^3"..newestVersionRaw.."^7)")
|
||||||
|
print("^1----------------------------------------------------------------------^7")
|
||||||
|
SetTimeout(1200000, function()
|
||||||
|
-- Do a naughty repeat message every 20 minutes until the the script is updated
|
||||||
|
CheckVersion()
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
print("^7'^3"..script.."^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..newestVersionRaw.."^7)")
|
print("^7'^3"..script.."^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..newestVersionRaw.."^7)")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ function getDurability(item)
|
|||||||
if v.name == item then
|
if v.name == item then
|
||||||
if v.slot <= lowestSlot then
|
if v.slot <= lowestSlot then
|
||||||
lowestSlot = v.slot
|
lowestSlot = v.slot
|
||||||
durability = itemcheck[k].info.durability
|
durability = itemcheck[k].info and itemcheck[k].info.durability or nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -445,7 +445,7 @@ function getDurability(item)
|
|||||||
if v.slot <= lowestSlot then
|
if v.slot <= lowestSlot then
|
||||||
debugPrint(v.slot, itemcheck[k].metadata.durability)
|
debugPrint(v.slot, itemcheck[k].metadata.durability)
|
||||||
lowestSlot = v.slot
|
lowestSlot = v.slot
|
||||||
durability = v.metadata.durability
|
durability = v.metadata and v.metadata.durability or nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -455,7 +455,7 @@ function getDurability(item)
|
|||||||
for _, v in pairs(itemcheck) do
|
for _, v in pairs(itemcheck) do
|
||||||
if v.name == item and v.slot <= lowestSlot then
|
if v.name == item and v.slot <= lowestSlot then
|
||||||
lowestSlot = v.slot
|
lowestSlot = v.slot
|
||||||
durability = v.info.durability
|
durability = v.info and v.info.durability or nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -465,7 +465,7 @@ function getDurability(item)
|
|||||||
for _, v in pairs(itemcheck) do
|
for _, v in pairs(itemcheck) do
|
||||||
if v.name == item and v.slot <= lowestSlot then
|
if v.name == item and v.slot <= lowestSlot then
|
||||||
lowestSlot = v.slot
|
lowestSlot = v.slot
|
||||||
durability = v.metadata.durability
|
durability = v.metadata and v.metadata.durability or nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -473,9 +473,9 @@ function getDurability(item)
|
|||||||
if isStarted(CodeMInv) then
|
if isStarted(CodeMInv) then
|
||||||
local itemcheck = exports[CodeMInv]:GetClientPlayerInventory()
|
local itemcheck = exports[CodeMInv]:GetClientPlayerInventory()
|
||||||
for _, v in pairs(itemcheck) do
|
for _, v in pairs(itemcheck) do
|
||||||
if v.name == item and v.slot <= lowestSlot then
|
if v.name == item and tonumber(v.slot) <= lowestSlot then
|
||||||
lowestSlot = v.slot
|
lowestSlot = tonumber(v.slot)
|
||||||
durability = v.info.durability
|
durability = v.info and v.info.durability or nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -485,7 +485,7 @@ function getDurability(item)
|
|||||||
for _, v in pairs(itemcheck) do
|
for _, v in pairs(itemcheck) do
|
||||||
if v.name == item and v.slot <= lowestSlot then
|
if v.name == item and v.slot <= lowestSlot then
|
||||||
lowestSlot = v.slot
|
lowestSlot = v.slot
|
||||||
durability = v.metadata.durability
|
durability = v.metadata and v.metadata.durability or nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -495,7 +495,7 @@ function getDurability(item)
|
|||||||
for _, v in pairs(itemcheck) do
|
for _, v in pairs(itemcheck) do
|
||||||
if v.name == item and v.slot <= lowestSlot then
|
if v.name == item and v.slot <= lowestSlot then
|
||||||
lowestSlot = v.slot
|
lowestSlot = v.slot
|
||||||
durability = v.metadata.durability
|
durability = v.metadata and v.metadata.durability or nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,13 @@
|
|||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
-- This attempts to sync up with the players framework onDuty variable
|
-- This attempts to sync up with the players framework onDuty variable
|
||||||
-- This stops the script getting confused when one is false and one is true
|
-- This stops the script getting confused when one is false and one is true
|
||||||
onDuty = not isServer() and getPlayer().onDuty or false
|
onDuty = false
|
||||||
|
|
||||||
|
if not isServer() then
|
||||||
|
onPlayerLoaded(function()
|
||||||
|
onDuty = getPlayer().onDuty
|
||||||
|
end, true)
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
-- Boss Role Detection
|
-- Boss Role Detection
|
||||||
|
|||||||
@@ -149,8 +149,8 @@ function BigMessage:ShowColoredShard(msg, desc, textColor, bgColor, duration, ma
|
|||||||
BeginScaleformMovieMethod(self.scaleform, "SHOW_SHARD_CENTERED_MP_MESSAGE")
|
BeginScaleformMovieMethod(self.scaleform, "SHOW_SHARD_CENTERED_MP_MESSAGE")
|
||||||
ScaleformMovieMethodAddParamPlayerNameString(msg)
|
ScaleformMovieMethodAddParamPlayerNameString(msg)
|
||||||
ScaleformMovieMethodAddParamPlayerNameString(desc)
|
ScaleformMovieMethodAddParamPlayerNameString(desc)
|
||||||
ScaleformMovieMethodAddParamInt(bgColor)
|
|
||||||
ScaleformMovieMethodAddParamInt(textColor)
|
ScaleformMovieMethodAddParamInt(textColor)
|
||||||
|
ScaleformMovieMethodAddParamInt(bgColor)
|
||||||
EndScaleformMovieMethod()
|
EndScaleformMovieMethod()
|
||||||
|
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ function openShop(data)
|
|||||||
elseif isStarted(OXInv) then
|
elseif isStarted(OXInv) then
|
||||||
exports[OXInv]:openInventory('shop', { type = data.shop })
|
exports[OXInv]:openInventory('shop', { type = data.shop })
|
||||||
|
|
||||||
elseif isStarted(QSInv) then
|
elseif isStarted(QSInv) or isStarted(CodeMInv) then
|
||||||
TriggerServerEvent("inventory:server:OpenInventory", "shop", data.items.label, data.items)
|
TriggerServerEvent("inventory:server:OpenInventory", "shop", data.items.label, data.items)
|
||||||
|
|
||||||
elseif isStarted(TgiannInv) then
|
elseif isStarted(TgiannInv) then
|
||||||
|
|||||||
@@ -227,7 +227,9 @@ function getStash(stashName)
|
|||||||
local stashItems, items = {}, {}
|
local stashItems, items = {}, {}
|
||||||
if isStarted(OXInv) then
|
if isStarted(OXInv) then
|
||||||
stashResource = OXInv
|
stashResource = OXInv
|
||||||
stashItems = exports[OXInv]:Inventory(stashName).items
|
local stash = exports[OXInv]:Inventory(stashName)
|
||||||
|
-- Add fallback if ox can't find the stash and returns a boolean
|
||||||
|
stashItems = type(stash) == "table" and stash.items or {}
|
||||||
|
|
||||||
elseif isStarted(QSInv) then
|
elseif isStarted(QSInv) then
|
||||||
stashResource = QSInv
|
stashResource = QSInv
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ function createEntityTarget(entity, opts, dist)
|
|||||||
options[i] = {
|
options[i] = {
|
||||||
icon = opts[i].icon,
|
icon = opts[i].icon,
|
||||||
label = opts[i].label,
|
label = opts[i].label,
|
||||||
item = opts[i].item or nil,
|
items = opts[i].item or nil,
|
||||||
groups = opts[i].job or opts[i].gang,
|
groups = opts[i].job or opts[i].gang,
|
||||||
onSelect = opts[i].action,
|
onSelect = opts[i].action,
|
||||||
distance = dist,
|
distance = dist,
|
||||||
@@ -230,7 +230,7 @@ function createBoxTarget(data, opts, dist)
|
|||||||
options[i] = {
|
options[i] = {
|
||||||
icon = opts[i].icon,
|
icon = opts[i].icon,
|
||||||
label = opts[i].label,
|
label = opts[i].label,
|
||||||
item = opts[i].item or nil,
|
items = opts[i].item or nil,
|
||||||
groups = opts[i].job or opts[i].gang,
|
groups = opts[i].job or opts[i].gang,
|
||||||
onSelect = opts[i].onSelect or opts[i].action,
|
onSelect = opts[i].onSelect or opts[i].action,
|
||||||
distance = dist,
|
distance = dist,
|
||||||
@@ -336,7 +336,7 @@ function createCircleTarget(data, opts, dist)
|
|||||||
options[i] = {
|
options[i] = {
|
||||||
icon = opts[i].icon,
|
icon = opts[i].icon,
|
||||||
label = opts[i].label,
|
label = opts[i].label,
|
||||||
item = opts[i].item or nil,
|
items = opts[i].item or nil,
|
||||||
groups = opts[i].job or opts[i].gang,
|
groups = opts[i].job or opts[i].gang,
|
||||||
onSelect = opts[i].onSelect or opts[i].action,
|
onSelect = opts[i].onSelect or opts[i].action,
|
||||||
distance = dist,
|
distance = dist,
|
||||||
@@ -418,7 +418,7 @@ function createModelTarget(models, opts, dist)
|
|||||||
options[i] = {
|
options[i] = {
|
||||||
icon = opts[i].icon,
|
icon = opts[i].icon,
|
||||||
label = opts[i].label,
|
label = opts[i].label,
|
||||||
item = opts[i].item or nil,
|
items = opts[i].item or nil,
|
||||||
groups = opts[i].job or opts[i].gang,
|
groups = opts[i].job or opts[i].gang,
|
||||||
onSelect = opts[i].action,
|
onSelect = opts[i].action,
|
||||||
distance = dist,
|
distance = dist,
|
||||||
|
|||||||
@@ -100,13 +100,15 @@ if isServer() then
|
|||||||
--- @param coords table|nil (Optional) Stash coordinates.
|
--- @param coords table|nil (Optional) Stash coordinates.
|
||||||
--- @usage
|
--- @usage
|
||||||
--- ```lua
|
--- ```lua
|
||||||
--- TriggerEvent(getScript()..":server:makeOXStash", name, label, slots, weight, owner, coords)
|
--- TriggerEvent(getScript()..":server:makeOXStash", name, label, slots, weight, owner, coords, token)
|
||||||
--- ```
|
--- ```
|
||||||
RegisterNetEvent(getScript()..":server:makeOXStash", function(name, label, slots, weight, owner, coords, token)
|
RegisterNetEvent(getScript()..":server:makeOXStash", function(name, label, slots, weight, owner, coords, token)
|
||||||
local src = source or nil
|
local src = source or nil
|
||||||
if src then
|
if src then
|
||||||
debugPrint("^1Auth^7: ^2Auth token received^7, ^2checking against server cache^7..")
|
debugPrint("^1Auth^7: ^2Auth token received^7, ^2checking against server cache^7..")
|
||||||
if token ~= validTokens[src] then
|
if token == nil then
|
||||||
|
debugPrint("^1Auth^7: ^1Token not received^7")
|
||||||
|
elseif token ~= validTokens[src] then
|
||||||
debugPrint("^1Auth^7: ^1Tokens don't match! ^7", token, validTokens[src])
|
debugPrint("^1Auth^7: ^1Tokens don't match! ^7", token, validTokens[src])
|
||||||
else
|
else
|
||||||
debugPrint("^1Auth^7: ^2Client and Server Auth tokens match^7!", token, validTokens[src])
|
debugPrint("^1Auth^7: ^2Client and Server Auth tokens match^7!", token, validTokens[src])
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.0.04
|
2.0.05
|
||||||
Reference in New Issue
Block a user