Koja Scripts
NEW

Admin Settings

This page covers admin permission configuration and available admin commands for managing Koja-Crafting.

Admin Settings

🔧 Configuration Options

All admin settings are located in shared/config.lua under the ADMIN PERMISSIONS section.

-- ════════════════════════════════════════════════════════════════════════════════════
--  ADMIN PERMISSIONS
-- ════════════════════════════════════════════════════════════════════════════════════

Config.AdminGroups = { 'admin', 'owner', 'superadmin', 'god' }

📝 Setting Description

Admin Groups

Config.AdminGroups = { 'admin', 'owner', 'superadmin', 'god' }

Purpose: Define which player groups have access to admin commands.

How it works:

  • The script checks if a player's group matches any entry in this list
  • Case-sensitive (must match exact group names in your framework)

🛠️ Available Admin Commands

  1. Add Blueprint Command

    Command: /addblueprint [playerID] [blueprintItem] Purpose: Grant a blueprint to a player, allowing them to craft special items. Syntax:
    /addblueprint [playerID] [blueprintItem]
    
    Parameters:
    ParameterTypeDescriptionExample
    playerIDNumberTarget player's server ID1, 5, 42
    blueprintItemStringBlueprint item name from configparachute_blueprint
    Examples:
    # Give parachute blueprint to player 1
    /addblueprint 1 parachute_blueprint
    
    # Give weapon blueprint to player 5
    /addblueprint 5 weapon_blueprint
    What happens:
    • Blueprint is added to player's database record
    • Player receives notification
    • Blueprint item becomes available in crafting menu
    • Player can now craft the associated item
    Requirements:
    • Player must be online
    • Blueprint must exist in crafting config
    • Item must have blueprintItem field defined
    Blueprint Configuration Example:
    blueprints = {
        {
            respname = 'parachute',
            name = 'Parachute',
            category = 'tools',
            image = './images/parachute.webp',
            blueprintItem = 'parachute_blueprint', -- This is what you use in command
            craftingTime = 120,
            requiredLevel = 4,
            resources = {
                { name = 'cloth', amount = 10 },
                { name = 'rope', amount = 5 }
            },
            exp = 100
        }
    }
  2. Add Experience Command

    Command: /addexp [playerID] [amount] Purpose: Grant experience points to a player for crafting level progression. Syntax:
    /addexp [playerID] [amount]
    
    Parameters:
    ParameterTypeDescriptionExample
    playerIDNumberTarget player's server ID1, 5, 42
    amountNumberXP amount to add100, 500, 1000
    Examples:
    # Give 100 XP to player 1
    /addexp 1 100
    
    # Give 500 XP to player 5 (might level up)
    /addexp 5 500
    What happens:
    • XP is added to player's current experience
    • Player's level is recalculated automatically
    • If enough XP, player levels up (possibly multiple times)
    • Player receives notification with new level
    • Progress saved to database immediately


📋 Permission Errors

"No permissions! You need admin rights to use this command."
  • Player doesn't have required group
  • Check Config.AdminGroups configuration
  • Verify player's actual group in framework
"Command error - contact administrator"
  • Framework detection failed
  • koja-lib not loaded properly
  • Check console for detailed error

Debugging Permission Issues

  1. Enable debug mode:
Config.Debug = true
  1. Check console output:
[KOJA-CRAFTING] Player 5 attempting admin command
[KOJA-CRAFTING] Player group: 'user'
[KOJA-CRAFTING] Required groups: admin, superadmin, owner
[KOJA-CRAFTING] Permission denied
  1. Check framework initialization:
[koja-crafting] INITIALIZING FRAMEWORK: ESX

📊 Admin Command Reference

CommandSyntaxPurposePermission Required
/addblueprint[playerID] [item]Grant blueprint to playerAdmin group
/addexp[playerID] [amount]Give XP to playerAdmin group

  • General Settings — This page covers the basic configuration options for Koja-Crafting that control debug mode, language, and player behavior.
  • Server Settings — This page covers server-side configuration options including database management, crafting recovery, and shared table functionality.
  • 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.
  • 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