Documentation
  • 📄TeamsGG Documentation
    • Common Errors
  • Paid Scripts
    • 📱Phone
      • 🧠Installation
      • 🦄Unique phones
      • 💿Configure
        • 💄Additional Features
        • 📸Camera
        • 🍏Apps
        • 🪵Logs
        • 🖼️Media Customization
        • 🗣️Multi-Language Support
        • 🗃️SIM Cards
        • 🚗Valet System
      • ⏭️Exports
        • Client side
          • 👁️‍🗨️General
          • ☀️Groups
          • 🏢Companies
          • 🔧Misc
        • Server side
          • 🆔Identify Player
          • ☎️Sim Cards
          • ☀️Groups
          • 🌐Cell Broadcast
          • 💸YPay
          • 📧Mail
          • 📪Notifications
          • 📵Screen Damage
          • 🔧Misc
      • 🪛Commands
      • 🍎Custom apps
    • ☎️Boomer Phone
      • 🧠Installation
      • 🦄Unique phones
      • ⏯️Exports
        • Client side
    • 🏠Properties
      • 🧠Installation
      • 💿Configure
      • 🐚Add More Shells
      • ⏭️Exports
        • Client side
          • GetCurrentPropertyId
          • GetCurrentProperty
          • IsPointInsideProperty
          • OpenPropertyMenu
          • AddKey
          • RemoveKey
          • SetWaypointToProperty
          • GetAllProperties
          • GetKeyHolders
          • PoliceRaidDoor
        • Server side
          • GetAllProperties
          • AddKey
          • RemoveKey
          • ToggleDoorlock
          • GetPlayersInProperty
          • GetKeyHolders
          • DeleteProperty
          • AddStarterApartment
      • 👜State bags
    • 🏦Banking
      • 🧠Installation
      • ⏯️Exports
        • Client side
        • Server side
    • 💸Billing
      • 🧠Installation
      • ⏭️Exports
        • Client side
        • Server side
    • 📊Hud
      • 🧠Installation
      • ⏭️Exports
        • Client side
    • 📦Storage Units
      • 🧠Installation
Powered by GitBook
On this page
  • Inventory Requirements
  • Configuration
  • SIM Mode Configuration
  • SIM Switch Settings
  • SIM Card Item Setup
  • QB-Inventory Format
  • OX-Inventory Format
  • SIM Modes Explained
  • Manual Mode
  • Auto Generate Mode
  • SIM Management Features
  • SIM Manager (Settings App)
  • SIM Card Properties
  • Implementation Examples
  • Creating SIM Cards via Command
  • Troubleshooting
  • Common Issues
  • Debug Steps
  1. Paid Scripts
  2. Phone
  3. Configure

SIM Cards

The SIM card system allows players to manage phone numbers through physical SIM card items in their inventory, providing realistic phone number management.

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:

-- Whether to enable the SIM switch functionality.
-- *manual: When a phone is initialized the phone won't have a SIM card. 
--          You need to have a SIM card item in your inventory. 
--          You can assign the SIM card to the phone via Settings app -> SIM Manager.
-- *auto_generate: When a phone is initialized, it will automatically 
--                  generate a SIM card and add it to the phone.
Config.Sim.Mode = 'auto_generate' -- options: 'manual', 'auto_generate'

SIM Switch Settings

-- Whether to enable the SIM switch functionality from the Settings app (Settings -> SIM Manager).
Config.Sim.EnableSimSwitch = true

SIM Card Item Setup

QB-Inventory Format

Add to qb-core/shared/items.lua:

ys_sim_card = { 
    name = 'ys_sim_card', 
    label = 'Sim Card', 
    weight = 10, 
    type = 'item', 
    image = 'ys_sim_card.png', 
    unique = true, 
    useable = false, 
    shouldClose = false, 
    combinable = nil, 
    description = 'A sim card' 
},

OX-Inventory Format

Add to ox_inventory/data/items.lua:

['ys_sim_card'] = {
    label = 'Sim Card',
    stack = false,
    weight = 10,
    consume = 0,
},

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

/createSimCard <simCardNumber>

Troubleshooting

Common Issues

  1. SIM cards not working: Check inventory integration is properly configured

  2. Metadata not saving: Ensure inventory supports metadata

  3. SIM Manager not accessible: Verify Config.Sim.EnableSimSwitch = true

  4. Auto-generation failing: Check SIM generation callback is working

Debug Steps

  1. Check server console for SIM-related errors

  2. Verify item definitions are correct for your inventory

  3. Test SIM card generation manually

  4. Ensure database permissions for SIM data storage


PreviousMulti-Language SupportNextValet System

Last updated 4 days ago

📱
💿
🗃️