Server Settings
🔧 Configuration Options
All server settings are located in shared/config.lua under the SERVER SETTINGS section.
-- ════════════════════════════════════════════════════════════════════════════════════
-- SERVER SETTINGS
-- ════════════════════════════════════════════════════════════════════════════════════
Config.CreateAutoTable = true
Config.CraftingItemsRecovery = true
Config.SharedTables = false
📝 Setting Descriptions
Automatic Database Creation
Config.CreateAutoTable = true
Purpose: Automatically create required database tables when the resource starts for the first time.
Options:
true- Database tables are created automatically (recommended for easy setup)false- Tables must be created manually usingkoja-crafting.sql
How it works: When enabled, the script will execute SQL queries on first startup to create three tables:
-
koja-crafting
Stores player data Fields:identifier- Player identifier (steam, license, etc.)blueprints- JSON array of unlocked blueprintslevel- Current crafting levelexp- Current experience points
-
koja-crafting-objects
Stores placed crafting stations Fields:id- Unique object IDcraftingId- Reference to crafting station configmodel- Prop model namex,y,z,heading- Object position and rotation
-
koja-crafting-queue
Stores crafting queue data Fields:id- Unique queue item IDidentifier- Player identifiercraftingTableId- Which table is being useditemName- Item being crafteditemImage- Item image pathamount- Quantity being craftedcraftingAmount- Items per craftexp- Experience gained on completionstartTime,endTime- Crafting timestampscraftingTime- Duration in secondscompleted- Whether crafting is finished
When to use each option:
✅ Use true (Auto-Create) when:
- First time installing the script
- Want quick and easy setup
- Don't have direct database access
- Prefer automated setup
✅ Use false (Manual Import) when:
- You have custom database naming conventions
- Want more control over table structure
- Already have tables from previous version
- Prefer manual database management
Crafting Items Recovery
Config.CraftingItemsRecovery = true
Purpose: Save crafting progress to database, allowing players to recover items after disconnect, server crash, or restart.
Options:
true- Crafting progress is saved to database (recommended)false- Crafting progress is lost on disconnect/restart
How it works:
-
When enabled (true)
- Player starts crafting an item
- Progress is saved to
koja-crafting-queuetable - If player disconnects, data remains in database
- When player reconnects, they can claim completed items
- Items show in queue menu with "CLAIM" button when ready
-
When disabled (false)
- Player starts crafting an item
- Progress stored only in memory (RAM)
- If player disconnects, crafting is lost
- If server restarts, all active crafts are cancelled
- No persistent storage
Example Scenarios:
| Scenario | Recovery Enabled | Recovery Disabled |
|---|---|---|
| Player crafts item, logs out normally | ✅ Can claim when back | ❌ Lost forever |
| Server crashes during crafting | ✅ Items recoverable | ❌ All progress lost |
| Player crashes/timeout | ✅ Progress saved | ❌ Must restart craft |
| Server restart for update | ✅ Queue preserved | ❌ Queue wiped |
Recommendation:
- ✅ Keep enabled for player satisfaction — prevents frustration from lost items. Adds minimal performance impact (one INSERT per craft start and updates on completion).
Performance Considerations:
- Minimal database writes
- Negligible impact on modern MySQL servers
- Benefits outweigh the small overhead
Shared Crafting Tables
Config.SharedTables = false
Purpose: Control whether crafting queues are shared between all players or personal to each player.
Options:
false- Each player has their own private queue (default)true- All players share the same queue per crafting station
How it works:
Personal Queues (false - Default):
- Each player sees only their own crafting items
- Other players can't interact with your queue
- Items are bound to your character
- Prevents griefing
Shared Queues (true):
- All players see the same queue at each station
- Anyone can claim completed items (first come, first served)
- Promotes teamwork and collaboration
- Risk of item theft if not managed
Use Cases:
| Server Type | Recommended Setting | Reason |
|---|---|---|
| Public Server | false (Personal) | Prevents griefing |
| Roleplay Server | true (Personal) | More realistic |
| Gang/Faction Server | true (Shared) | Team collaboration |
| Whitelisted Community | true (Shared) | Trust between players |
🔍 Troubleshooting
Tables not created automatically
- Check if
oxmysqlis running - Verify database connection in server.cfg
- Check console for SQL errors
- Try manual import if auto-create fails
Recovery not working
- Verify
Config.CraftingItemsRecovery = true - Check if
koja-crafting-queuetable exists - Look for database errors in console
- Ensure oxmysql is up to date
Shared tables not functioning
- Confirm
Config.SharedTables = true - Restart resource after config change
- Check if multiple players are at same station ID
- Verify station IDs match in config
Database permissions error
- Grant CREATE, INSERT, UPDATE, DELETE permissions
- Check MySQL user has table creation rights
- Verify connection credentials
📊 Monitoring Database Health (FOR EMERGENCY)
Check active crafting entries:
SELECT COUNT(*) FROM `koja-crafting-queue` WHERE completed = 0;
Check player progression:
SELECT identifier, level, exp FROM `koja-crafting` ORDER BY level DESC LIMIT 10;
Find stuck/old crafting items:
SELECT * FROM `koja-crafting-queue`
WHERE completed = 0
AND endTime < UNIX_TIMESTAMP(NOW()) * 1000;
📚 Related Settings
- For player data configuration, see Player Progression
- For queue behavior, see Crafting Queue Settings
- For installation guide, see Installation
Related pages
- General Settings — This page covers the basic configuration options for Koja-Crafting that control debug mode, language, and player behavior.
- Images Settings — This page explains how to configure item images, add custom graphics, and manage image paths in Koja-Crafting.
- Player Progression Settings — This page covers the player progression system including levels, experience points, and how to configure the leveling system in Koja-Crafting.
- Admin Settings — This page covers admin permission configuration and available admin commands for managing Koja-Crafting.
- Interaction Settings — This page covers how players interact with crafting stations - either through key press or target system (ox_target,qb-target,).
- Crafting Queue Settings — This page covers the crafting queue system that manages distance checking, warnings, and crafting cancellation when players move away from stations.
- Configuration — back to the section overview