🗃️ SIM Cards
Inventory Requirements
To use SIM cards as items, you need one of the following inventories or any other inventory that supports metadata:
- ox_inventory (Recommended)
- qb-inventory
- ps-inventory
- lj-inventory
- codem-inventory
- core-inventory
Note: For other inventories, you'll need to integrate them yourself.
Configuration
SIM Mode Configuration
Navigate to config/config.sim.lua and configure the SIM mode:
lua
SIM Switch Settings
lua
SIM Card Item Setup
QB-Inventory Format
Add to qb-core/shared/items.lua:
lua
OX-Inventory Format
Add to ox_inventory/data/items.lua:
lua
SIM Modes Explained
Manual Mode
- How it works: Players start without a SIM card in their phone
- Usage: Players must obtain a SIM card item and insert it via Settings -> SIM Manager
- Benefits: More realistic, allows for SIM card trading/selling
- Drawbacks: Requires players to actively manage SIM cards
Auto Generate Mode
- How it works: Automatically creates and assigns a SIM card when phone is initialized
- Usage: No player interaction required
- Benefits: Seamless experience, no management required
- Drawbacks: Less realistic, no SIM card economy
SIM Management Features
SIM Manager (Settings App)
- Access: Settings app -> SIM Manager
- Functions:
- View current SIM information
- Remove current SIM card
- Insert new SIM card from inventory
- View SIM card details (number)
SIM Card Properties
- Card ID: Unique identifier for each SIM card
- Phone Number: Associated phone number
- Metadata: Stored in item metadata for persistence
Implementation Examples
Creating SIM Cards via Command
lua
Troubleshooting
Common Issues
- SIM cards not working: Check inventory integration is properly configured
- Metadata not saving: Ensure inventory supports metadata
- SIM Manager not accessible: Verify
Config.Sim.EnableSimSwitch = true - Auto-generation failing: Check SIM generation callback is working
Debug Steps
- Check server console for SIM-related errors
- Verify item definitions are correct for your inventory
- Test SIM card generation manually
- Ensure database permissions for SIM data storage