mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-18 06:26:01 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61e0d777a8 |
@@ -1,6 +1,6 @@
|
|||||||
name "Jim_Bridge"
|
name "Jim_Bridge"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "1.0.1"
|
version "1.0.2"
|
||||||
description "Framework Bridge By Jimathy"
|
description "Framework Bridge By Jimathy"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.0.1
|
1.0.2
|
||||||
|
|||||||
22
wrapper.lua
22
wrapper.lua
@@ -60,7 +60,7 @@ end
|
|||||||
|
|
||||||
-- Load Vehicles
|
-- Load Vehicles
|
||||||
if GetResourceState(QBXExport):find("start") then
|
if GetResourceState(QBXExport):find("start") then
|
||||||
Core = Core or exports[QBXExport]:GetCoreObject()
|
Core = Core or exports[QBExport]:GetCoreObject()
|
||||||
print("^6Bridge^7: ^2Loading ^3Vehicles^2 from ^7"..QBXExport)
|
print("^6Bridge^7: ^2Loading ^3Vehicles^2 from ^7"..QBXExport)
|
||||||
Vehicles = exports[QBXExport]:GetVehiclesByHash()
|
Vehicles = exports[QBXExport]:GetVehiclesByHash()
|
||||||
elseif GetResourceState(QBExport):find("start") then
|
elseif GetResourceState(QBExport):find("start") then
|
||||||
@@ -937,12 +937,30 @@ function setVehicleProperties(vehicle, props)
|
|||||||
format(vehicle))
|
format(vehicle))
|
||||||
end
|
end
|
||||||
if GetResourceState(OXLibExport):find("start") then
|
if GetResourceState(OXLibExport):find("start") then
|
||||||
lib.setVehicleProperties(vehicle, props)
|
TriggerServerEvent(GetCurrentResourceName()..":ox:setVehicleProperties", VehToNet(vehicle), props)
|
||||||
elseif GetResourceState(QBExport):find("start") then
|
elseif GetResourceState(QBExport):find("start") then
|
||||||
Core.Functions.SetVehicleProperties(vehicle, props)
|
Core.Functions.SetVehicleProperties(vehicle, props)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RegisterNetEvent(GetCurrentResourceName()..":ox:setVehicleProperties", function(netId, props)
|
||||||
|
local vehicle = NetworkGetEntityFromNetworkId(netId)
|
||||||
|
local value = props
|
||||||
|
Entity(vehicle).state[GetCurrentResourceName()..':setVehicleProperties'] = value
|
||||||
|
end)
|
||||||
|
|
||||||
|
AddStateBagChangeHandler(GetCurrentResourceName()..':setVehicleProperties', '', function(bagName, _, value)
|
||||||
|
if not value or not GetEntityFromStateBagName then return end
|
||||||
|
local entity = GetEntityFromStateBagName(bagName)
|
||||||
|
local networked = not bagName:find('localEntity')
|
||||||
|
|
||||||
|
if networked and NetworkGetEntityOwner(entity) ~= cache.playerId then return end
|
||||||
|
|
||||||
|
if lib.setVehicleProperties(entity, value) then
|
||||||
|
Entity(entity).state:set('setVehicleProperties', nil, true)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
RegisterNetEvent(GetCurrentResourceName()..":server:ChargePlayer", function(cost, type) local src = source
|
RegisterNetEvent(GetCurrentResourceName()..":server:ChargePlayer", function(cost, type) local src = source
|
||||||
if Config.System.Debug then print("^6Bridge^7: ^2Charging ^2Player: '^6"..cost.."^7'", type) end
|
if Config.System.Debug then print("^6Bridge^7: ^2Charging ^2Player: '^6"..cost.."^7'", type) end
|
||||||
if type == "cash" then
|
if type == "cash" then
|
||||||
|
|||||||
Reference in New Issue
Block a user