-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bridge for esx, ndcore, oxcore
- Loading branch information
Showing
14 changed files
with
113 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
local framework = {} | ||
|
||
return framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ESX = exports.es_extended:getSharedObject() | ||
|
||
RegisterNetEvent('esx:playerLoaded', function() | ||
ESX.PlayerLoaded = true | ||
TriggerServerEvent('fd_laptop:server:playerLoaded') | ||
end) | ||
|
||
RegisterNetEvent('esx:onPlayerLogout', function() | ||
ESX.PlayerLoaded = false | ||
TriggerServerEvent('fd_laptop:server:playerUnloaded') | ||
end) | ||
|
||
RegisterNetEvent('fd_laptop:client:appsReady', function() | ||
if not ESX.PlayerLoaded then return end | ||
|
||
TriggerServerEvent('fd_laptop:server:playerLoaded') | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ESX = exports.es_extended:getSharedObject() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
local framework = {} | ||
|
||
---@param src number | ||
---@return string|nil | ||
function framework.getIdentifier(src) | ||
local player = ESX.GetPlayerFromId(src) | ||
|
||
if not player then | ||
return nil | ||
end | ||
|
||
return player.identifier | ||
end | ||
|
||
return framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
local framework = {} | ||
|
||
return framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
NDCore = exports.ND_Core | ||
|
||
RegisterNetEvent('ND:characterLoaded', function() | ||
LocalPlayer.state.isLoggedIn = true | ||
TriggerServerEvent('fd_laptop:server:playerLoaded') | ||
end) | ||
|
||
RegisterNetEvent('ND:characterUnloaded', function() | ||
LocalPlayer.state.isLoggedIn = false | ||
TriggerServerEvent('fd_laptop:server:playerUnloaded') | ||
end) | ||
|
||
RegisterNetEvent('fd_laptop:client:appsReady', function() | ||
if not LocalPlayer.state.isLoggedIn then return end | ||
|
||
TriggerServerEvent('fd_laptop:server:playerLoaded') | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NDCore = exports.ND_Core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
local framework = {} | ||
|
||
---@param src number | ||
---@return string|nil | ||
function framework.getIdentifier(src) | ||
local player = NDCore:getPlayer(src) | ||
|
||
if not player then | ||
return nil | ||
end | ||
|
||
return player.getData('identifier') | ||
end | ||
|
||
return framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
return { | ||
{ 'qbx_core', 'qbox' }, | ||
{ 'qb-core', 'qbcore' } | ||
{ 'qb-core', 'qbcore' }, | ||
{ 'es_extended', 'esx' }, | ||
{ 'ox_core', 'oxcore' }, | ||
{ 'ND_Core', 'ndcore' }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
local framework = {} | ||
|
||
return framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Ox = require '@ox_core.lib.init' | ||
local playerLoaded | ||
|
||
AddEventHandler('ox:playerLoaded', function() | ||
playerLoaded = true | ||
TriggerServerEvent('fd_laptop:server:playerLoaded') | ||
end) | ||
|
||
AddEventHandler('ox:playerLogout', function() | ||
playerLoaded = false | ||
TriggerServerEvent('fd_laptop:server:playerUnloaded') | ||
end) | ||
|
||
RegisterNetEvent('fd_laptop:client:appsReady', function() | ||
if not playerLoaded then return end | ||
|
||
TriggerServerEvent('fd_laptop:server:playerLoaded') | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Ox = require '@ox_core.lib.init' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
local framework = {} | ||
|
||
---@param src number | ||
---@return string|nil | ||
function framework.getIdentifier(src) | ||
local player = Ox.GetPlayer(src) | ||
|
||
if not player then | ||
return nil | ||
end | ||
|
||
return player.stateId | ||
end | ||
|
||
return framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters