Phone numbers
QuanticPhone generates phone numbers automatically when players first use the phone. You control the format, length, and area codes.
Number format
lua
Config.PhoneNumber = {
Length = 7, -- digits after the area code
Format = "(%s)%s", -- sprintf format: first %s = DDD, second %s = number
DDDs = { "11", "21", "31", "41", "51", "61", "71", "81", "85", "91" },
}With the default config, a generated number looks like (11)5559990 — the DDD is wrapped in parentheses followed by 7 random digits.
| Key | Default | Description |
|---|---|---|
| Length | 7 | Number of digits generated after the area code |
| Format | "(%s)%s" | Lua string.format pattern for the full number |
| DDDs | table | Array of area codes; one is picked randomly per player |
Format examples:
lua
Format = "(%s)%s" --> (11)5559990
Format = "%s-%s" --> 11-5559990
Format = "%s %s" --> 11 5559990
Format = "+55%s%s" --> +55115559990Area codes (DDDs)
The DDDs table is an array of strings. A random one is selected when a player's number is first generated. You can use any strings — not limited to Brazilian area codes:
lua
-- Brazilian area codes (default)
Config.PhoneNumber.DDDs = { "11", "21", "31", "41", "51", "61", "71", "81", "85", "91" }
-- Single fixed code (everyone gets the same prefix)
Config.PhoneNumber.DDDs = { "555" }
-- US-style codes
Config.PhoneNumber.DDDs = { "212", "310", "415", "713", "305" }Phone numbers are generated once and stored in the database. Changing the DDDs table does not affect existing players — only new ones.
Unique numbers per item
With Config.Item.Unique = true, each physical phone item in the player's inventory has its own number stored in item metadata. This means:
- A player can carry multiple phones, each with a different number
- Trading or dropping the item passes the number to the new owner
- The number persists across restarts because it lives in the inventory metadata
- Your inventory must support item metadata (ox_inventory, qb-inventory, qs-inventory)
With
Unique = false, the phone number is tied to the player's identifier (citizenid / identifier) and is the same regardless of which phone item they carry.