nd core removed to incomplete bridging, same for ox_core
nd_core adoption remains low, same for ox_core. Instead of updating the other bridges easily and going through hoops on these we have decided to abandon the support for them. If someone reads this and wishes to *complete* and pr them back in it is welcomed. Until then they are holding back progress.
This commit is contained in:
1 parent
aa551d6f58
commit
971da2ec51
4 files changed
-480
No files matched your search
@@ -1,61 +0,0 @@
|
||||
if GetResourceState('ND_Core') ~= 'started' then return end
|
||||
|
||||
local NDCore = exports["ND_Core"]:GetCoreObject()
|
||||
|
||||
Framework = {}
|
||||
|
||||
Framework.GetPlayerData = function()
|
||||
return NDCore:getPlayer()
|
||||
end
|
||||
|
||||
Framework.GetPlayerMetaData = function(metadata)
|
||||
return NDCore:getPlayer().metadata[metadata]
|
||||
end
|
||||
|
||||
--[[
|
||||
-- Unused by this framework
|
||||
Framework.GetItemInfo = function(item)
|
||||
|
||||
end
|
||||
|
||||
Framework.GetPlayerInventory = function()
|
||||
|
||||
end
|
||||
--]]
|
||||
|
||||
Framework.GetPlayerIdentifier = function()
|
||||
return NDCore:getPlayer().id
|
||||
end
|
||||
|
||||
Framework.GetPlayerName = function()
|
||||
return NDCore:getPlayer().fullname
|
||||
end
|
||||
|
||||
Framework.GetPlayerJob = function()
|
||||
local player = NDCore:getPlayer().jobInfo
|
||||
return player.name, player.label, player.rankname, player.rank
|
||||
end
|
||||
|
||||
Framework.GetIsPlayerDead = function()
|
||||
local playerState = LocalPlayer.state
|
||||
return playerState.dead
|
||||
end
|
||||
|
||||
RegisterNetEvent("ND:characterLoaded",function(character)
|
||||
Wait(1500)
|
||||
FillBridgeTables()
|
||||
TriggerEvent('community_bridge:Client:OnPlayerLoaded')
|
||||
end)
|
||||
|
||||
RegisterNetEvent("ND:characterUnloaded",function()
|
||||
ClearClientSideVariables()
|
||||
TriggerEvent('community_bridge:Client:OnPlayerUnload')
|
||||
end)
|
||||
|
||||
RegisterNetEvent("ND:updateCharacter", function(character)
|
||||
PlayerJobName = character.jobInfo.name
|
||||
PlayerJobLabel = character.jobInfo.label
|
||||
PlayerJobGradeName = character.jobInfo.rankName
|
||||
PlayerJobGradeLevel = character.jobInfo.rank
|
||||
TriggerEvent('community_bridge:Client:OnPlayerJobUpdate', PlayerJobName, PlayerJobLabel, PlayerJobGradeName, PlayerJobGradeLevel)
|
||||
end)
|
||||
@@ -1,208 +0,0 @@
|
||||
--local NDCore = exports["ND_Core"]:GetCoreObject()
|
||||
if GetResourceState('ND_Core') ~= 'started' then return end
|
||||
local NDCore = exports["ND_Core"]
|
||||
|
||||
Framework = {}
|
||||
|
||||
-- Framework.GetPlayerIdentifier(src)
|
||||
-- Returns the citizen ID of the player.
|
||||
Framework.GetPlayerIdentifier = function(src)
|
||||
local player = NDCore:getPlayer(src)
|
||||
return player.id
|
||||
end
|
||||
|
||||
-- Framework.GetPlayerName(src)
|
||||
-- Returns the first and last name of the player.
|
||||
Framework.GetPlayerName = function(src)
|
||||
local player = NDCore:getPlayer(src)
|
||||
return player.fullname
|
||||
end
|
||||
|
||||
--[[
|
||||
-- Unused by this framework
|
||||
Framework.GetItem = function(src, item, metadata)
|
||||
|
||||
end
|
||||
|
||||
Framework.GetItemCount = function(src, item, metadata)
|
||||
|
||||
end
|
||||
|
||||
Framework.GetPlayerInventory = function(src)
|
||||
|
||||
end
|
||||
|
||||
Framework.AddItem = function(src, item, amount, slot, metadata)
|
||||
|
||||
end
|
||||
|
||||
Framework.RemoveItem = function(src, item, amount, slot, metadata)
|
||||
|
||||
end
|
||||
|
||||
Framework.SetMetadata = function(src, item, slot, metadata)
|
||||
|
||||
end
|
||||
|
||||
|
||||
Framework.Commands = {}
|
||||
Framework.Commands.Add = function(name, help, arguments, argsrequired, callback, permission, ...)
|
||||
|
||||
end
|
||||
|
||||
--]]
|
||||
|
||||
-- Framework.SetMetadata(src, metadata, value)
|
||||
-- Adds the specified metadata key and number value to the player's data.
|
||||
Framework.SetPlayerMetadata = function(src, metadata, value)
|
||||
local player = NDCore:getPlayer(src)
|
||||
player.setMetadata(metadata, value)
|
||||
return true
|
||||
end
|
||||
|
||||
-- Framework.GetMetadata(src, metadata)
|
||||
-- Gets the specified metadata key to the player's data.
|
||||
Framework.GetPlayerMetadata = function(src, metadata)
|
||||
local player = NDCore:getPlayer(src)
|
||||
local playerData = player.getMetadata(metadata)
|
||||
return playerData or false
|
||||
end
|
||||
|
||||
-- Framework.AddStress(src, value)
|
||||
-- Adds the specified value to the player's stress level and updates the client HUD.
|
||||
Framework.AddStress = function(src, value)
|
||||
print("Not Bridged Yet")
|
||||
return 0
|
||||
end
|
||||
|
||||
-- Framework.RemoveStress(src, value)
|
||||
-- Removes the specified value from the player's stress level and updates the client HUD.
|
||||
Framework.RemoveStress = function(src, value)
|
||||
print("Not Bridged Yet")
|
||||
return 0
|
||||
end
|
||||
|
||||
-- Framework.AddHunger(src, value)
|
||||
-- Adds the specified value from the player's hunger level.
|
||||
Framework.AddHunger = function(src, value)
|
||||
-- Im stuck
|
||||
end
|
||||
|
||||
-- Framework.AddThirst(src, value)
|
||||
-- Adds the specified value from the player's thirst level.
|
||||
Framework.AddThirst = function(src, value)
|
||||
-- Im stuck
|
||||
end
|
||||
|
||||
Framework.GetHunger = function(src)
|
||||
local player = NDCore:getPlayer(src)
|
||||
local metaData = player.metadata
|
||||
local hunger = metaData.status.hunger.status
|
||||
return hunger
|
||||
end
|
||||
|
||||
Framework.GetThirst = function(src)
|
||||
local player = NDCore:getPlayer(src)
|
||||
local metaData = player.metadata
|
||||
local thirst = metaData.status.thirst.status
|
||||
return thirst
|
||||
end
|
||||
|
||||
-- Framework.GetPlayerPhone(src)
|
||||
-- Returns the phone number of the player.
|
||||
Framework.GetPlayerPhone = function(src)
|
||||
local player = NDCore:getPlayer(src)
|
||||
return player.phonenumber
|
||||
end
|
||||
|
||||
-- Framework.GetPlayerGang(src)
|
||||
-- Returns the gang name of the player.
|
||||
Framework.GetPlayerGang = function(src)
|
||||
print("Not Bridged Yet")
|
||||
return "none"
|
||||
end
|
||||
|
||||
-- Framework.GetPlayersByJob(jobname)
|
||||
-- returns a table of player sources that have the specified job name.
|
||||
Framework.GetPlayersByJob = function(job)
|
||||
local playerList = {}
|
||||
local players = NDCore:getPlayers("job", job, false)
|
||||
for playerSource, _ in pairs(players) do
|
||||
table.insert(playerList, playerSource)
|
||||
end
|
||||
return playerList
|
||||
end
|
||||
|
||||
-- Framework.GetPlayerJob(src)
|
||||
-- Returns the job name, label, grade name, and grade level of the player.
|
||||
Framework.GetPlayerJob = function(src)
|
||||
local player = NDCore:getPlayer(src)
|
||||
local jobName, jobInfo = player.getJob()
|
||||
return jobInfo.name, jobInfo.label, jobInfo.rankName, jobInfo.rank
|
||||
end
|
||||
|
||||
-- Framework.SetPlayerJob(src, name, grade)
|
||||
-- Sets the player's job to the specified name and grade.
|
||||
Framework.SetPlayerJob = function(src, name, grade)
|
||||
local player = NDCore:getPlayer(src)
|
||||
return player.setJob(name, grade)
|
||||
end
|
||||
|
||||
Framework.ToggleDuty = function(src, status)
|
||||
print("Not Bridged Yet")
|
||||
return false
|
||||
end
|
||||
|
||||
-- Framework.AddAccountBalance(src, _type, amount)
|
||||
-- Adds the specified amount to the player's account balance of the specified type.
|
||||
Framework.AddAccountBalance = function(src, _type, amount)
|
||||
local player = NDCore:getPlayer(src)
|
||||
if _type == 'money' then _type = 'cash' end
|
||||
return player.addMoney(_type, amount, "")
|
||||
end
|
||||
|
||||
-- Framework.RemoveAccountBalance(src, _type, amount)
|
||||
-- Removes the specified amount from the player's account balance of the specified type.
|
||||
Framework.RemoveAccountBalance = function(src, _type, amount)
|
||||
local player = NDCore:getPlayer(src)
|
||||
if _type == 'money' then _type = 'cash' end
|
||||
return player.deductMoney(_type, amount, "")
|
||||
end
|
||||
|
||||
-- Framework.GetAccountBalance(src, _type)
|
||||
-- Returns the player's account balance of the specified type.
|
||||
Framework.GetAccountBalance = function(src, _type)
|
||||
local player = NDCore:getPlayer(src)
|
||||
if _type == 'money' then _type = 'cash' end
|
||||
return player.getData(_type)
|
||||
end
|
||||
|
||||
Framework.GetOwnedVehicles = function(src)
|
||||
local player = NDCore:getPlayer(src)
|
||||
local vehicles = NDCore:getVehicles(player.id)
|
||||
local foundvehicles = {}
|
||||
for i=1, #vehicles do
|
||||
local veh = vehicles[i]
|
||||
table.insert(foundvehicles, {vehicle = veh.properties.model, plate = veh.plate})
|
||||
end
|
||||
return foundvehicles
|
||||
end
|
||||
|
||||
Framework.RegisterUsableItem = function(itemName, cb)
|
||||
exports(itemName, function(event, item, inventory, slot, data)
|
||||
local slotData = exports.ox_inventory:GetSlot(inventory.id, slot)
|
||||
if event == 'usingItem' then
|
||||
cb(inventory.id, slotData)
|
||||
return false
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterNetEvent("ND:characterUnloaded", function()
|
||||
TriggerEvent("community_bridge:Server:OnPlayerUnload", source)
|
||||
end)
|
||||
|
||||
AddEventHandler("playerDropped", function()
|
||||
local src = source
|
||||
TriggerEvent("community_bridge:Server:OnPlayerUnload", src)
|
||||
end)
|
||||
@@ -1,64 +0,0 @@
|
||||
if GetResourceState('ox_core') ~= 'started' then return end
|
||||
|
||||
local Ox = require '@ox_core.lib.init'
|
||||
|
||||
Framework = {}
|
||||
|
||||
Framework.GetPlayerData = function()
|
||||
-- wip
|
||||
end
|
||||
|
||||
Framework.GetPlayerMetaData = function(metadata)
|
||||
-- wip
|
||||
end
|
||||
|
||||
Framework.GetPlayerIdentifier = function()
|
||||
local player = Ox.GetPlayer()
|
||||
return player.stateId
|
||||
end
|
||||
|
||||
Framework.GetPlayerName = function()
|
||||
local player = Ox.GetPlayer()
|
||||
local first = player.get('firstName')
|
||||
local last = player.get('lastName')
|
||||
return first, last
|
||||
end
|
||||
|
||||
Framework.GetPlayerJob = function()
|
||||
local group, grade, title = Ox.getGroupInfo()
|
||||
return group, title, title, grade
|
||||
end
|
||||
|
||||
Framework.HasItem = function()
|
||||
local itemCount = ox_inventory:Search('count', item)
|
||||
local hasItem = itemCount ~= 0
|
||||
return hasItem
|
||||
end
|
||||
|
||||
Framework.GetPlayerInventory = function()
|
||||
return exports.ox_inventory:GetPlayerItems()
|
||||
end
|
||||
|
||||
Framework.GetIsPlayerDead = function()
|
||||
-- wip
|
||||
end
|
||||
|
||||
RegisterNetEvent('ox:playerLoaded', function()
|
||||
Wait(1500)
|
||||
FillBridgeTables()
|
||||
TriggerEvent('community_bridge:Client:OnPlayerLoaded')
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('ox:playerLogout', function()
|
||||
ClearClientSideVariables()
|
||||
TriggerEvent('community_bridge:Client:OnPlayerUnload')
|
||||
end)
|
||||
|
||||
RegisterNetEvent('ox:setGroup', function(name, grade)
|
||||
PlayerJobName = name
|
||||
PlayerJobLabel = name
|
||||
PlayerJobGradeName = grade
|
||||
PlayerJobGradeLevel = grade
|
||||
TriggerEvent('community_bridge:Client:OnPlayerJobUpdate',PlayerJobName, PlayerJobLabel, PlayerJobGradeName, PlayerJobGradeLevel)
|
||||
end)
|
||||
@@ -1,147 +0,0 @@
|
||||
if GetResourceState('ox_core') ~= 'started' then return end
|
||||
|
||||
local Ox = require '@ox_core.lib.init'
|
||||
|
||||
Framework = {}
|
||||
|
||||
-- Framework.GetPlayerIdentifier(src)
|
||||
-- Returns the citizen ID of the player.
|
||||
Framework.GetPlayerIdentifier = function(src)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetPlayerName(src)
|
||||
-- Returns the first and last name of the player.
|
||||
Framework.GetPlayerName = function(src)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetItem(src, item, metadata)
|
||||
-- Returns a table of items matching the specified name and if passed metadata from the player's inventory.
|
||||
-- returns {name = v.name, count = v.amount, metadata = v.info, slot = v.slot}
|
||||
Framework.GetItem = function(src, item, _)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetItemCount(src, item, _)
|
||||
-- Returns the count of items matching the specified name and if passed metadata from the player's inventory.
|
||||
Framework.GetItemCount = function(src, item, _)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetPlayerInventory(src)
|
||||
-- Returns the entire inventory of the player as a table.
|
||||
-- returns {name = v.name, count = v.amount, _, _}
|
||||
Framework.GetPlayerInventory = function(src)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.SetMetadata(src, metadata, value)
|
||||
-- Adds the specified metadata key and number value to the player's data.
|
||||
Framework.SetPlayerMetadata = function(src, metadata, value)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetMetadata(src, metadata)
|
||||
-- Gets the specified metadata key and value to the player's data.
|
||||
Framework.GetPlayerMetadata = function(src, metadata)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- defualt esx Available tables are
|
||||
-- identifier, accounts, group, inventory, job, job_grade, loadout,
|
||||
-- metadata, position, firstname, lastname, dateofbirth, sex, height,
|
||||
-- skin, status, is_dead, id, disabled, last_property, created_at, last_seen,
|
||||
-- phone_number, pincode
|
||||
Framework.GetStatus = function(src, column)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.AddThirst(src, value)
|
||||
-- Adds the specified value from the player's thirst level.
|
||||
Framework.AddThirst = function(src, value)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.AddHunger(src, value)
|
||||
-- Adds the specified value from the player's hunger level.
|
||||
Framework.AddHunger = function(src, value)
|
||||
-- wip
|
||||
end
|
||||
|
||||
Framework.GetHunger = function(src)
|
||||
-- wip
|
||||
end
|
||||
|
||||
Framework.GetThirst = function(src)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetPlayerPhone(src)
|
||||
-- Returns the phone number of the player.
|
||||
Framework.GetPlayerPhone = function(src)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetPlayerJob(src)
|
||||
-- Returns the job name, label, grade name, and grade level of the player.
|
||||
Framework.GetPlayerJob = function(src)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetPlayersByJob(jobname)
|
||||
-- returns a table of player sources that have the specified job name.
|
||||
Framework.GetPlayersByJob = function(job)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.SetPlayerJob(src, name, grade)
|
||||
-- Sets the player's job to the specified name and grade.
|
||||
Framework.SetPlayerJob = function(src, name, grade)
|
||||
-- wip
|
||||
end
|
||||
|
||||
Framework.ToggleDuty = function(src, status)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.AddAccountBalance(src, _type, amount)
|
||||
-- Adds the specified amount to the player's account balance of the specified type.
|
||||
Framework.AddAccountBalance = function(src, _type, amount)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.RemoveAccountBalance(src, _type, amount)
|
||||
-- Removes the specified amount from the player's account balance of the specified type.
|
||||
Framework.RemoveAccountBalance = function(src, _type, amount)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.GetAccountBalance(src, _type)
|
||||
-- Returns the player's account balance of the specified type.
|
||||
Framework.GetAccountBalance = function(src, _type)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.AddItem(src, item, amount, _, _)
|
||||
-- Adds the specified item to the player's inventory.
|
||||
Framework.AddItem = function(src, item, amount, slot, metadata)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.RemoveItem(src, item, amount, _, _)
|
||||
-- Removes the specified item from the player's inventory.
|
||||
Framework.RemoveItem = function(src, item, amount, slot, metadata)
|
||||
-- wip
|
||||
end
|
||||
|
||||
-- Framework.RegisterUsableItem(item, cb)
|
||||
-- Registers a usable item with a callback function.
|
||||
Framework.RegisterUsableItem = function(itemName, cb)
|
||||
exports(itemName, function(event, item, inventory, slot, data)
|
||||
local slotData = exports.ox_inventory:GetSlot(inventory.id, slot)
|
||||
if event == 'usingItem' then
|
||||
cb(inventory.id, item, slotData)
|
||||
end
|
||||
end)
|
||||
end
|
||||
Reference in new issue
Block a user