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
|
||||
print("^7'^3jim_bridge^7' - ^2You are running the latest version^7. ^7(^3"..currentVersionRaw.."^7)")
|
||||
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("^1----------------------------------------------------------------------^7")
|
||||
SetTimeout(1200000, function()
|
||||
-- Do a naughty repeat message every 20 minutes until the the script is updated
|
||||
CheckBridgeVersion()
|
||||
end)
|
||||
else
|
||||
print("^7'^3jim_bridge^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..newestVersionRaw.."^7)")
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name "Jim_Bridge"
|
||||
author "Jimathy"
|
||||
version "2.0.04"
|
||||
version "2.0.05"
|
||||
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.'
|
||||
|
||||
@@ -51,7 +51,13 @@ function CheckVersion()
|
||||
if compareResult == 0 then
|
||||
print("^7'^3"..script.."^7' - ^2You are running the latest version^7. (^3"..currentVersionRaw.."^7)")
|
||||
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("^1----------------------------------------------------------------------^7")
|
||||
SetTimeout(1200000, function()
|
||||
-- Do a naughty repeat message every 20 minutes until the the script is updated
|
||||
CheckVersion()
|
||||
end)
|
||||
else
|
||||
print("^7'^3"..script.."^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..fallbackVersionRaw.."^7)")
|
||||
end
|
||||
@@ -63,7 +69,13 @@ function CheckVersion()
|
||||
if compareResult == 0 then
|
||||
print("^7'^3"..script.."^7' - ^2You are running the latest version^7. (^3"..currentVersionRaw.."^7)")
|
||||
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("^1----------------------------------------------------------------------^7")
|
||||
SetTimeout(1200000, function()
|
||||
-- Do a naughty repeat message every 20 minutes until the the script is updated
|
||||
CheckVersion()
|
||||
end)
|
||||
else
|
||||
print("^7'^3"..script.."^7' - ^5You are running a newer version ^7(^3"..currentVersionRaw.."^7 ← ^3"..newestVersionRaw.."^7)")
|
||||
end
|
||||
|
||||
@@ -433,7 +433,7 @@ function getDurability(item)
|
||||
if v.name == item then
|
||||
if v.slot <= lowestSlot then
|
||||
lowestSlot = v.slot
|
||||
durability = itemcheck[k].info.durability
|
||||
durability = itemcheck[k].info and itemcheck[k].info.durability or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -445,7 +445,7 @@ function getDurability(item)
|
||||
if v.slot <= lowestSlot then
|
||||
debugPrint(v.slot, itemcheck[k].metadata.durability)
|
||||
lowestSlot = v.slot
|
||||
durability = v.metadata.durability
|
||||
durability = v.metadata and v.metadata.durability or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -455,7 +455,7 @@ function getDurability(item)
|
||||
for _, v in pairs(itemcheck) do
|
||||
if v.name == item and v.slot <= lowestSlot then
|
||||
lowestSlot = v.slot
|
||||
durability = v.info.durability
|
||||
durability = v.info and v.info.durability or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -465,7 +465,7 @@ function getDurability(item)
|
||||
for _, v in pairs(itemcheck) do
|
||||
if v.name == item and v.slot <= lowestSlot then
|
||||
lowestSlot = v.slot
|
||||
durability = v.metadata.durability
|
||||
durability = v.metadata and v.metadata.durability or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -473,9 +473,9 @@ function getDurability(item)
|
||||
if isStarted(CodeMInv) then
|
||||
local itemcheck = exports[CodeMInv]:GetClientPlayerInventory()
|
||||
for _, v in pairs(itemcheck) do
|
||||
if v.name == item and v.slot <= lowestSlot then
|
||||
lowestSlot = v.slot
|
||||
durability = v.info.durability
|
||||
if v.name == item and tonumber(v.slot) <= lowestSlot then
|
||||
lowestSlot = tonumber(v.slot)
|
||||
durability = v.info and v.info.durability or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -485,7 +485,7 @@ function getDurability(item)
|
||||
for _, v in pairs(itemcheck) do
|
||||
if v.name == item and v.slot <= lowestSlot then
|
||||
lowestSlot = v.slot
|
||||
durability = v.metadata.durability
|
||||
durability = v.metadata and v.metadata.durability or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -495,7 +495,7 @@ function getDurability(item)
|
||||
for _, v in pairs(itemcheck) do
|
||||
if v.name == item and v.slot <= lowestSlot then
|
||||
lowestSlot = v.slot
|
||||
durability = v.metadata.durability
|
||||
durability = v.metadata and v.metadata.durability or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
-------------------------------------------------------------
|
||||
-- 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
|
||||
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
|
||||
|
||||
@@ -149,8 +149,8 @@ function BigMessage:ShowColoredShard(msg, desc, textColor, bgColor, duration, ma
|
||||
BeginScaleformMovieMethod(self.scaleform, "SHOW_SHARD_CENTERED_MP_MESSAGE")
|
||||
ScaleformMovieMethodAddParamPlayerNameString(msg)
|
||||
ScaleformMovieMethodAddParamPlayerNameString(desc)
|
||||
ScaleformMovieMethodAddParamInt(bgColor)
|
||||
ScaleformMovieMethodAddParamInt(textColor)
|
||||
ScaleformMovieMethodAddParamInt(bgColor)
|
||||
EndScaleformMovieMethod()
|
||||
|
||||
self.duration = duration
|
||||
|
||||
@@ -157,7 +157,7 @@ function openShop(data)
|
||||
elseif isStarted(OXInv) then
|
||||
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)
|
||||
|
||||
elseif isStarted(TgiannInv) then
|
||||
|
||||
@@ -227,7 +227,9 @@ function getStash(stashName)
|
||||
local stashItems, items = {}, {}
|
||||
if isStarted(OXInv) then
|
||||
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
|
||||
stashResource = QSInv
|
||||
|
||||
@@ -121,7 +121,7 @@ function createEntityTarget(entity, opts, dist)
|
||||
options[i] = {
|
||||
icon = opts[i].icon,
|
||||
label = opts[i].label,
|
||||
item = opts[i].item or nil,
|
||||
items = opts[i].item or nil,
|
||||
groups = opts[i].job or opts[i].gang,
|
||||
onSelect = opts[i].action,
|
||||
distance = dist,
|
||||
@@ -230,7 +230,7 @@ function createBoxTarget(data, opts, dist)
|
||||
options[i] = {
|
||||
icon = opts[i].icon,
|
||||
label = opts[i].label,
|
||||
item = opts[i].item or nil,
|
||||
items = opts[i].item or nil,
|
||||
groups = opts[i].job or opts[i].gang,
|
||||
onSelect = opts[i].onSelect or opts[i].action,
|
||||
distance = dist,
|
||||
@@ -336,7 +336,7 @@ function createCircleTarget(data, opts, dist)
|
||||
options[i] = {
|
||||
icon = opts[i].icon,
|
||||
label = opts[i].label,
|
||||
item = opts[i].item or nil,
|
||||
items = opts[i].item or nil,
|
||||
groups = opts[i].job or opts[i].gang,
|
||||
onSelect = opts[i].onSelect or opts[i].action,
|
||||
distance = dist,
|
||||
@@ -418,7 +418,7 @@ function createModelTarget(models, opts, dist)
|
||||
options[i] = {
|
||||
icon = opts[i].icon,
|
||||
label = opts[i].label,
|
||||
item = opts[i].item or nil,
|
||||
items = opts[i].item or nil,
|
||||
groups = opts[i].job or opts[i].gang,
|
||||
onSelect = opts[i].action,
|
||||
distance = dist,
|
||||
|
||||
@@ -100,13 +100,15 @@ if isServer() then
|
||||
--- @param coords table|nil (Optional) Stash coordinates.
|
||||
--- @usage
|
||||
--- ```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)
|
||||
local src = source or nil
|
||||
if src then
|
||||
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])
|
||||
else
|
||||
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