rectangle-terminalCommands

This page covers all available commands in Koja-Crafting, their usage, permissions, and examples.


πŸ“‹ Command Overview

Koja-Crafting provides two admin commands for managing player progression and blueprints:

Command
Purpose
Permission
Usage

/addblueprint

Grant blueprint to player

Admin

[playerID] [item]

/addexp

Give experience to player

Admin

[playerID] [amount]


πŸ” Permission System

Who Can Use Commands?

Commands are restricted to players with admin permissions. Access is controlled by Config.AdminGroups:

-- In shared/config.lua
Config.AdminGroups = { 'admin', 'owner', 'superadmin', 'god' }

How it works:

  • Script checks player's job/group from framework (ESX/QBCore)

  • If player's group matches any in Config.AdminGroups, command executes

  • If no match, player receives permission denied message

Configuration Examples:

For detailed permission setup, see Admin Permissions.


πŸ”· Add Blueprint Command

Command Syntax


Parameters

Parameter
Type
Description
Required

playerID

Number

Target player's server ID

βœ… Yes

blueprintItem

String

Blueprint item name from config

βœ… Yes


What It Does

1

Grants a special blueprint to the specified player.

2

Saves blueprint to player's database record (koja-crafting table).

3

Unlocks the corresponding item in crafting menu (if level requirement met).

4

Sends notification to the player.

5

Persists through server restarts and player disconnects.


Blueprint Configuration

In shared/config.lua:

Command to give:


Error Messages

chevron-rightBlueprint Command β€” Error Messageshashtag
Error
Cause
Solution

"No permissions!"

Not admin

Add your group to Config.AdminGroups

"Invalid player ID"

Player offline or wrong ID

Check player is online with /players

"Blueprint not found"

Wrong blueprint name

Check blueprintItem in config

"Player already has blueprint"

Duplicate

No action needed (already unlocked)


πŸ“Š Add Experience Command

Command Syntax


Parameters

Parameter
Type
Description
Required

playerID

Number

Target player's server ID

βœ… Yes

amount

Number

XP amount to add

βœ… Yes


What It Does

1

Adds specified XP to player's current experience.

2

Automatically calculates if player levels up.

3

Handles multiple level-ups in one command.

4

Saves progress to database immediately.

5

Notifies player of new level/XP.

6

Unlocks items if new level requirement met.


Error Messages

chevron-rightAddExp Command β€” Error Messageshashtag
Error
Cause
Solution

"No permissions!"

Not admin

Add group to Config.AdminGroups

"Invalid player ID"

Wrong ID/offline

Verify with /players

"Invalid amount"

Negative/zero

Use positive number

"Command error"

Framework issue

Check koja-lib is running


πŸ› οΈ Console vs In-Game

Running from Server Console

Commands can also be executed from server console:

Note: When running from console (source = 0), permission checks are bypassed.


πŸ“Š Command Reference Table

Command
Syntax
Permission
Purpose
Persistent

/addblueprint

[id] [item]

Admin

Grant blueprint

βœ… Yes

/addexp

[id] [amount]

Admin

Give XP

βœ… Yes


  • For permission setup, see Admin Permissions

  • For XP system details, see Player Progression

  • For blueprint configuration, see Crafting Stations

  • For server setup, see Server Settings

Last updated