Installation
NRG SimCard for LBphone
Required Scripts ⚙️
Before starting the installation process, ensure the following dependencies are installed:
es_extended
ox_lib
ox_inventory
lb-phone
oxmysql
ox_target
Installation Steps 🛠️
Move
NRGSimCustom
to LB-Phone Script 📂In the
lb-phone
script, navigate toclient > custom
.Move the
NRGSimCustom
folder directly tolb-phone > client > custom
.
Check
Config.Item.Unique
inlb-phone/config/config.lua
🔧Open
lb-phone/config/config.lua
.Locate the following line
Config.Item.Unique
andConfig.DatabaseChecker.AutoFix
If it is set to
true
, change it tofalse
:
Config.Item.Unique = false Config.DatabaseChecker.Enabled = false -- not necessary* Config.DatabaseChecker.AutoFix = false -- not necessary*
Add items to
ox_inventory
Script 📝Open the
ox_inventory > data > items.lua
Add the following code for the new items:
["phone"] = { label = "Phone", -- Translate this label to your desired language weight = 190, stack = false, consume = 0, client = { export = "nrg_simcard.simPhoneOpen", add = function() TriggerEvent("nrg_simcard:itemAddedPhone") end }, buttons = { { label = 'SIM Cards', -- Translate this label action = function(slot) TriggerEvent('nrg_simcard:SimCards', slot) end }, { label = 'Turn On/Off', -- Translate this label action = function(slot) TriggerEvent('nrg_simcard:TurnPhoneON', slot) end }, } }, ["custom_number"] = { label = "BON - Custom number", -- Translate this label weight = 100, stack = true, description = "Receive a Custom number at the SIM shop", -- Translate description }, ["sim_card"] = { label = "SIM Card", -- Translate this label weight = 190, stack = false, consume = 0, client = { add = function() TriggerEvent("nrg_simcard:itemAddedSIM") end }, },
Item Duplication Check: Before adding the above code, check if the item name already exists in the
ox_inventory
configuration. If they exist replace them.
Add Script to Resources 📁 After editing the
ox_inventory
, you need to ensure that the script is properly added to your server.Place the
nrg_simcard
folder inside yourresources
directory.In your
server.cfg
orresources.cfg
file, add the following line to ensure the script is loaded:
ensure nrg_simcard
Database Setup 🗄️ When you run the script for the first time, a new database called
nrg_simcard
will be automatically created in your MySQL database.⚠️ The script must be uploaded to a clean database with LB phone without any data ⚠️
*if you want to leave the option:
Config.DatabaseChecker.AutoFix = true
Go to lb-phone/server/misc/databaseChecker/databaseChecker.lua
Find and remove or comment:
if tables.phone_backups.phone_number.keyType ~= "PRI" then
MySQL.rawExecute.await([[
ALTER TABLE phone_backups
DROP PRIMARY KEY,
ADD PRIMARY KEY (`id`, `phone_number`)
]])
updateChanges = true
end
This guide will ensure a smooth installation of the NRG SimCard script. Follow the steps carefully to avoid errors and conflicts. If you encounter any issues or need further assistance, feel free to reach out!
Last updated