Job Definition Structure
Jobs are defined in configuration files undermythic-jobs/config/defaultJobs/:
Job Types
Job category for organization and behaviorOptions:
"Company"- Private businesses (restaurants, shops, etc.)"Government"- Government agencies (police, medical, etc.)
- Government jobs typically have higher salaries and special permissions
- Company jobs can be player-owned with business management
Unique job identifierRules:
- Lowercase, no spaces
- Use underscores for multi-word jobs
- Must be unique across all jobs
"police", "ems", "beanmachine", "auto_exotics"Display name shown to playersExamples:
"Police", "Medical", "Bean Machine", "Auto Exotics"Base salary amount per paycheck intervalGuidelines:
- Entry-level jobs: $150-300
- Skilled jobs: $300-600
- Professional jobs: $600-1200
- Government jobs: $800-1500
Salary multiplier tier (1-5)Determines final paycheck amount:
FinalPay = Salary * SalaryTier * (GradeLevel / 100)Examples:- Tier 1: Standard pay (1.0x)
- Tier 2: Higher pay (1.5x)
- Tier 3: Premium pay (2.0x)
- Tier 4: Executive pay (2.5x)
- Tier 5: Top pay (3.0x)
Unix timestamp of last configuration updateUsed for tracking changes and migrations
Job Structures
Simple Job Structure
For single-location businesses without departments:Complex Job Structure (Workplaces)
For organizations with multiple departments or locations:- Job has multiple departments/locations
- Each location has separate chain of command
- Employees are assigned to specific workplace
- Examples: Police departments, medical facilities, restaurant chains
Grade Configuration
Grades represent ranks or positions within a job:Grade Fields
Unique identifier for this gradeRules:
- Lowercase, no spaces
- Unique within the job
- Should not conflict across workplaces
"cadet", "officer", "sergeant", "chief"Display name for the gradeExamples:
"Cadet", "Officer", "Sergeant", "Chief of Police"Numeric level representing rank hierarchy (1-99)Guidelines:
- Entry level: 1-10
- Junior: 11-25
- Mid-level: 26-50
- Senior: 51-75
- Leadership: 76-90
- Command: 91-99
- Salary calculations
- Permission hierarchies
- Promotion system
- Rank comparisons
Table of permission keys with boolean valuesDetermines what actions this grade can perform
Grade Levels Best Practices
Permission System
Permissions control what actions employees can perform. They are boolean flags checked throughout the framework.Common Permissions
Job Management:Permission Hierarchy Example
Custom Permissions
You can create custom permissions for your resources:Creating Custom Jobs
Step 1: Create Job Configuration File
Create a new file inmythic-jobs/config/defaultJobs/:
Step 2: Add to fxmanifest.lua
Ensure your job file is loaded:Step 3: Restart Resource
Step 4: Assign Job to Players
Complete Job Examples
Restaurant Example
Mechanic Shop Example
Security Company Example
Best Practices
Meaningful Grade Levels
Meaningful Grade Levels
Space out grade levels to allow for expansion:
Progressive Permissions
Progressive Permissions
Higher grades should include lower grade permissions:
Salary Balance
Salary Balance
Balance salaries across jobs:
Clear Permission Names
Clear Permission Names
Use descriptive, consistent permission names:
Workplace Organization
Workplace Organization
Only use workplaces when necessary:Use workplaces for:
- Multiple departments (LSPD, BCSO, SASP)
- Different locations with separate management
- Jobs where workplace assignment matters
- Single-location businesses
- Jobs with one hierarchy
- Simple employee structure
Checking Permissions in Code
Server-Side Permission Checks
Client-Side Permission Checks
Callback Permission Check
Troubleshooting
Job not appearing in game
Job not appearing in game
Possible causes:
-
Job file not loaded in fxmanifest.lua
-
Syntax error in job definition
- Check server console for Lua errors
- Validate Lua syntax
-
Resource not restarted
-
Duplicate job ID
- Ensure job ID is unique
- Check for conflicts with existing jobs
Permissions not working
Permissions not working
Check:
-
Permission spelling - Must match exactly
-
Permission assigned to grade
-
Character has correct job and grade
-
On-duty requirement - Some features require being on duty
Salary not paying correctly
Salary not paying correctly
Verify:
-
Salary configuration
- Paycheck interval - Check server configuration
- On-duty requirement - Paychecks only when clocked in
- Bank account setup - Ensure character has bank account