Closed ShortWlf closed 2 years ago
ESX to QBCORE Conversion Thread - this is for chaining a ESX framework mod into QBCore aka Qbus framework.
ESX to QBCORE Object Reference
ESX = nil Citizen.CreateThread(function() while ESX == nil do TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Citizen.Wait(30)-- Saniye Bekletme end end)
' QBCORE - ESX REPLACEMENT '
QBCore = nil local QBCore = exports['qb-core']:GetCoreObject() Citizen.CreateThread(function() while QBCore == nil do TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end) Citizen.Wait(30) -- Saniye Bekletme end end)
ESX Load player identifier
RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded',
RegisterNetEvent('QBCore:Client:OnPlayerLoaded') AddEventHandler('QBCore:Client:OnPlayerLoaded',
ESX Check JOB
RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob',
RegisterNetEvent('QBCore:Client:OnJobUptade') AddEventHandler('QBCore:Client:OnJobUptade',
ESX Player Death
RegisterNetEvent('esx:onPlayerDeath') AddEventHandler('esx:onPlayerDeath',
RegisterNetEvent('QBCore:Client:OnPlayerUnload') AddEventHandler('QBCore:Client:OnPlayerUnload',
ESX Get Closest Player ESX.Game.GetClosestPlayer()
ESX.Game.GetClosestPlayer()
' QBCORE - ESX REPLACEMENT ' QBCore.Functions.GetClosestPlayer() ' ESX OPEN Close Menu '
QBCore.Functions.GetClosestPlayer()
DrawText3D(1, 1, 1, 'Sample') ESX.Game.Utils.DrawText3D(1, 1, 1, 'Sample')
QBCore.UI.Menu.Open QBCore.UI.Menu.CloseAll()
ESX Notification Display
TriggerEvent('Notification',"Text/Samle.") ESX.ShowHelpNotification('Text/Samle.')
TriggerClientEvent("QBCore:Notify", "Text/Sample, "success", 2500) QBCore.Functions.Notify("Text/Sample.", "error")
ESX Get Inventory Item xPlayer.getInventoryItem
xPlayer.getInventoryItem
' QBCORE - ESX REPLACEMENT ' xPlayer.Functions.GetItemByName
xPlayer.Functions.GetItemByName
ESX Get player name xPlayer.getName()
xPlayer.getName()
' QBCORE - ESX REPLACEMENT ' xPlayer.PlayerData.name
xPlayer.PlayerData.name
ESX Set current job
AddEventHandler('esx:setJob', function(job) PlayerData.job = job end)``` ' QBCORE - ESX REPLACEMENT ' ```RegisterNetEvent('QBCore:Client:OnJobUpdate') AddEventHandler('QBCore:Client:OnJobUpdate', function(job) PlayerData.job = job end)``` ESX add or remove money ```xPlayer.removeAccountMoney('bank', amount) xPlayer.addMoney(amount)``` ' QBCORE - ESX REPLACEMENT ' Player.Functions.AddMoney('bank', amount, "Bank depost") Player.Functions.RemoveMoney('cash', amount, "Bank depost") ESX Get bank Funds `xPlayer.getAccount('bank').money ` ' QBCORE - ESX REPLACEMENT ' Player.PlayerData.money["bank"] ESX ADD/Remove Item xPlayer.addInventoryItem xPlayer.removeInventoryItem ' QBCORE - ESX REPLACEMENT ' ```xPlayer.Functions.RemoveItem xPlayer.Functions.AddItem```
Changing the language and layout on the original file.
https://github.com/ShortWlf/QbusToEsx
ESX to QBCORE Conversion Thread - this is for chaining a ESX framework mod into QBCore aka Qbus framework.
ESX to QBCORE Object Reference
' QBCORE - ESX REPLACEMENT '
ESX Load player identifier
' QBCORE - ESX REPLACEMENT '
ESX Check JOB
' QBCORE - ESX REPLACEMENT '
ESX Player Death
' QBCORE - ESX REPLACEMENT '
ESX Get Closest Player
ESX.Game.GetClosestPlayer()
' QBCORE - ESX REPLACEMENT '
QBCore.Functions.GetClosestPlayer()
' ESX OPEN Close Menu '' QBCORE - ESX REPLACEMENT '
ESX Notification Display
' QBCORE - ESX REPLACEMENT '
ESX Get Inventory Item
xPlayer.getInventoryItem
' QBCORE - ESX REPLACEMENT '
xPlayer.Functions.GetItemByName
ESX Get player name
xPlayer.getName()
' QBCORE - ESX REPLACEMENT '
xPlayer.PlayerData.name
ESX Set current job