Complete step-by-step installation instructions for QC-AdvancedMedic on RedM servers using RSG-Core framework.
Before installing, ensure your server has:
- RedM Server: Build 1436 or higher
- RSG-Core Framework: Latest version
- MySQL/MariaDB: Version 5.7+ (MySQL) or 10.2+ (MariaDB)
- oxmysql: Latest version
- ox_lib: Latest version
- rsg-inventory: Latest version
- rsg-bossmenu: Latest version
# Check RedM server version
# In server console, type: version
# Verify database connection
# In server console, check for: [oxmysql] Database server connection established
# Check required resources are started
# In server console: ensure rsg-core
# In server console: ensure ox_libCRITICAL: Always backup before installing new resources.
# Backup your database
mysqldump -u [username] -p [database_name] > backup_$(date +%Y%m%d).sql
# Backup your resources folder (optional but recommended)
cp -r resources resources_backup_$(date +%Y%m%d)- Download the latest release from GitHub
- Extract the
QC-AdvancedMedicfolder - Place in your server's resources directory:
YourServer/
└── resources/
└── [quantum]/ # Or your custom resource folder
└── QC-AdvancedMedic/
Verify folder structure:
QC-AdvancedMedic/
├── fxmanifest.lua ✓ Present
├── config.lua ✓ Present
├── client/ ✓ Folder with 9 files
├── server/ ✓ Folder with 6 files
├── ui/ ✓ Folder with build/
├── locales/ ✓ Folder with JSON files
└── INSTALL_FIRST/ ✓ Folder with SQL and items
Option A: HeidiSQL (Recommended for Windows)
- Open HeidiSQL and connect to your database
- Navigate to your RedM database (usually
rsgor similar) - Click File → Run SQL file
- Select
INSTALL_FIRST/schema.sql - Click Execute (blue play button)
- Verify success message: "4 tables created, 2 procedures created"
Option B: MySQL Command Line
# Navigate to QC-AdvancedMedic folder
cd /path/to/resources/[quantum]/QC-AdvancedMedic/INSTALL_FIRST
# Execute schema
mysql -u [username] -p [database_name] < schema.sql
# Verify tables were created
mysql -u [username] -p [database_name] -e "SHOW TABLES LIKE 'player_%';"Expected Output:
| Tables_in_[db] (player_%) |--+
| player_wounds |
| player_infections |
| player_fractures |
| medical_treatments |
| medical_history |--+
Option C: phpMyAdmin
- Login to phpMyAdmin
- Select your RedM database
- Click Import tab
- Choose file:
INSTALL_FIRST/schema.sql - Click Go
- Check for success message
Location: rsg-core/shared/items.lua
- Open
INSTALL_FIRST/shared_items.luain a text editor - Copy the entire contents
- Open
rsg-core/shared/items.lua - Scroll to the bottom of the items table (before the closing
}) - Paste the copied items
- Important: Ensure proper comma separation
Example:
-- In rsg-core/shared/items.lua
RSGShared.Items = {
-- ... existing items ...
['water'] = {
['name'] = 'water',
['label'] = 'Water',
-- ... existing item data ...
}, -- ← Make sure this comma exists!
-- Paste QC-AdvancedMedic items here:
['bandage'] = {
['name'] = 'bandage',
['label'] = 'Bandage',
['weight'] = 100,
['type'] = 'item',
['image'] = 'bandage.png',
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Basic cloth bandage for treating wounds'
},
-- ... rest of medical items ...
}Items Added (24 total):
- Medical supplies: bandage, cotton_bandage, linen_bandage, sterile_bandage
- Emergency: rope_tourniquet, leather_tourniquet, cloth_tourniquet, medical_tourniquet
- Medicines: laudanum, morphine, whiskey, quinine
- Injections: adrenaline, cocaine, strychnine, saline
- Equipment: medicalbag, stethoscope, thermometer
- Consumables: antiseptic, penicillin, surgical_kit
- Crafting: cotton, linen, leather_strips, medical_supplies
Location: rsg-inventory/html/images/
- Navigate to
INSTALL_FIRST/IMAGES/folder - Copy all PNG files (3 core images provided):
bandage.pngcotton.pngmedicalbag.png
- Paste into
rsg-inventory/html/images/
Note: The provided images are core items. Additional items will use placeholder images until you add custom ones.
Missing Images Checklist (you'll need to source these):
- cotton_bandage.png
- linen_bandage.png
- sterile_bandage.png
- rope_tourniquet.png
- leather_tourniquet.png
- cloth_tourniquet.png
- medical_tourniquet.png
- laudanum.png
- morphine.png
- whiskey.png (may already exist)
- quinine.png
- adrenaline.png
- cocaine.png
- strychnine.png
- saline.png
- stethoscope.png
- thermometer.png
- antiseptic.png
- penicillin.png
- surgical_kit.png
- linen.png
- leather_strips.png
- medical_supplies.png
Recommended Image Specs:
- Format: PNG with transparency
- Size: 256x256 pixels (or 512x512 for high-res)
- Style: Match your server's inventory theme
Required Configuration:
- Open
config.luain a text editor - Update medic job locations to match your server:
Config.MedicJobLocations = {
{
name = 'Valentine Medical Office', -- Display name
prompt = 'valmedic', -- Prompt label
coords = vector3(-281.82, 809.39, 119.38),-- Your coordinates
showblip = true, -- Show on map?
blipsprite = 'blip_shop_doctor', -- Blip icon
blipscale = 0.2, -- Blip size
job = 'valmedic' -- EXACT job name from database
},
{
name = 'Saint Denis Hospital',
prompt = 'sdmedic',
coords = vector3(2721.28, -1230.74, 50.37),
showblip = true,
blipsprite = 'blip_shop_doctor',
blipscale = 0.2,
job = 'sdmedic'
},
-- Add more locations as needed
}Finding Your Coordinates:
-- In-game, stand at desired location and run:
/coords
-- Or use this command to print to F8 console:
-- Press F8 and type:
GetEntityCoords(PlayerPedId())- Verify job names match your
rsg-corejob database:
-- Run this query to see all jobs in your database:
SELECT * FROM jobs;
-- Make sure your Config.MedicJobLocations[].job values match the 'name' column- Adjust server-specific settings:
-- In config.lua, customize these for your server:
Config.MaxHealth = 600 -- Match your server's max health
Config.DeathTimer = 300 -- Seconds before respawn (5 min default)
Config.WipeInventoryOnRespawn = true -- Clear items on death?
Config.WipeCashOnRespawn = true -- Clear cash on death?
Config.EnableScreenEffects = true -- Blood/pain visual effects?- Configure mission locations (optional):
Open ConfigMissions.lua and update coordinates:
Config.MissionLocations = {
valentine = {
vector3(-324.66, 803.94, 117.88), -- Update to your locations
vector3(-175.39, 626.77, 114.09),
-- ... more locations
},
-- ... other towns
}- Open your
server.cfgfile - Add the resource in the appropriate section:
# Medical Systems
ensure QC-AdvancedMedicLoad Order Matters - Ensure these start BEFORE QC-AdvancedMedic:
ensure oxmysql
ensure ox_lib
ensure rsg-core
ensure rsg-inventory
ensure rsg-bossmenu
# Then start medical system:
ensure QC-AdvancedMedicFor Test/Development Servers:
# In server console:
restart QC-AdvancedMedicFor Production Servers:
# Full server restart recommended for first installation:
stop
# Wait 10 seconds
startWatch for errors in console during startup:
- ✓
[QC-AdvancedMedic] Resource started successfully - ✓
[oxmysql] Query executed successfully - ✗
[script:QC-AdvancedMedic] SCRIPT ERROR- See troubleshooting below
-- Check tables exist:
SHOW TABLES LIKE 'player_%';
SHOW TABLES LIKE 'medical_%';
-- Check stored procedures:
SHOW PROCEDURE STATUS WHERE Db = '[your_database_name]';
-- Expected: GetCompleteMedicalProfile, CleanupExpiredMedicalDataAs Admin:
/heal → Should restore health
/revive → Should revive if downed
As Player:
- Check inventory for medical items (give yourself a bandage via admin)
- Take damage (fall, shoot yourself)
- Use bandage - should see NUI interface
- Check F8 console for errors
As Medic:
- Get hired at medic job:
/setjob [yourID] valmedic 4 - Go to medic location (blip should appear on map)
- Access storage (should see 48 slots)
- Try
/inspect [playerID]on another player - Craft medical bag using materials from storage
- Complete a training mission
- As medic, use
/inspect [targetID] - NUI should open showing body diagram
- Click on body parts - should show wound details
- Try applying a treatment
- Check browser console (F8 → Console tab) for JavaScript errors
Error: Table 'player_wounds' doesn't exist
-- Verify database name in oxmysql configuration:
-- Check server.cfg or database.cfg for:
set mysql_connection_string "mysql://user:password@localhost/DATABASE_NAME"
-- Make sure you ran schema.sql on the CORRECT database
-- Re-run if needed:
mysql -u root -p CORRECT_DATABASE_NAME < INSTALL_FIRST/schema.sqlError: Stored procedure not found
-- Check procedures exist:
SHOW PROCEDURE STATUS WHERE Db = '[your_database]';
-- If missing, manually execute the CREATE PROCEDURE statements
-- from INSTALL_FIRST/schema.sqlError: Item 'bandage' not found in shared items
Solution:
- Verify you added items to
rsg-core/shared/items.lua - Check for syntax errors (missing commas, brackets)
- Restart
rsg-coreresource:
restart rsg-core
- Then restart QC-AdvancedMedic:
restart QC-AdvancedMedic
Error: Item images show as placeholder
Solution:
- Check image file names match EXACTLY (case-sensitive):
bandage.png✓Bandage.png✗bandage.PNG✗
- Clear browser cache (Ctrl+F5 in-game)
- Verify images are in correct folder:
rsg-inventory/html/images/
Error: "You are not a medic" when you ARE a medic
Solution:
- Check your job name in database:
SELECT job FROM players WHERE citizenid = '[your_citizenid]';- Make sure it matches EXACTLY in
Config.MedicJobLocations:
job = 'valmedic' -- Must match database exactly (case-sensitive)- Check helper function is loaded:
-- In F8 console in-game:
IsMedicJob('valmedic') -- Should return true if workingError: NUI doesn't open when using /inspect
Solution:
- Check browser console (F8 → Console tab) for errors
- Verify NUI files exist:
ui/
└── build/
├── index.html ← Must exist
├── static/
│ ├── css/
│ └── js/
└── asset-manifest.json
- Try clearing FiveM cache:
- Close RedM
- Navigate to
%localappdata%/RedM/FiveM Application Data - Delete
cachefolder - Restart RedM
Error: Body parts not clickable
Solution:
- Check screen resolution - UI optimized for 1920x1080
- Try windowed mode instead of fullscreen
- Check browser console for click handler errors
- Verify image files exist in
ui/build/static/media/
Symptom: Server lag when multiple players have wounds
Solution:
- Increase tick intervals in
config.lua:
Config.BleedingProgression = 2 -- Increase from 1 to 2 minutes
Config.PainProgression = 2 -- Increase from 1 to 2 minutes
Config.InfectionTickInterval = 5 -- Increase from 2 to 5 minutes- Reduce wound history retention:
Config.MaxScarsPerPlayer = 3 -- Reduce from 5 to 3- Run database cleanup procedure manually:
CALL CleanupExpiredMedicalData();Add jobs to your RSG-Core job system:
-- Example job insertion (adjust for your system):
INSERT INTO jobs (name, label) VALUES ('valmedic', 'Valentine Medic');
INSERT INTO jobs (name, label) VALUES ('sdmedic', 'Saint Denis Medic');
-- Set up job grades:
INSERT INTO job_grades (job_name, grade, name, label, salary, isboss)
VALUES
('valmedic', 0, 'recruit', 'Recruit', 50, 0),
('valmedic', 1, 'medic', 'Medic', 75, 0),
('valmedic', 2, 'surgeon', 'Surgeon', 100, 0),
('valmedic', 3, 'chief', 'Chief Physician', 150, 1);Add initial supplies to medic storage:
-- In-game as admin:
/openinv storage_valmedic_1 -- Access storage
-- Then use admin menu to add items:
-- 10x bandage
-- 10x cotton_bandage
-- 5x linen_bandage
-- 5x antiseptic
-- 3x morphine
-- 2x surgical_kitEdit config.lua to customize medical bag crafting:
Config.BagCraftingRecipe = {
{item = 'leather', amount = 5},
{item = 'thread', amount = 3},
{item = 'medical_supplies', amount = 1}
}- Create medic job guide document for players
- Demonstrate
/inspectcommand usage - Show how to complete training missions
- Explain infection prevention (bandage grace period)
- Review scar system for medical RP
Linux Server:
# Add to crontab:
0 3 * * * mysql -u [user] -p[pass] [database] -e "CALL CleanupExpiredMedicalData();"Windows Server (Task Scheduler):
- Create batch file
cleanup_medical.bat:
mysql -u [user] -p[pass] [database] -e "CALL CleanupExpiredMedicalData();"- Schedule to run daily at 3:00 AM
If you need to remove QC-AdvancedMedic:
# In server.cfg, remove or comment out:
# ensure QC-AdvancedMedicDROP TABLE IF EXISTS player_wounds;
DROP TABLE IF EXISTS medical_treatments;
DROP TABLE IF EXISTS player_infections;
DROP TABLE IF EXISTS medical_history;
DROP PROCEDURE IF EXISTS GetCompleteMedicalProfile;
DROP PROCEDURE IF EXISTS CleanupExpiredMedicalData;- Open
rsg-core/shared/items.lua - Remove all QC-AdvancedMedic items
- Restart
rsg-core
rm -rf resources/[quantum]/QC-AdvancedMedicIf you encounter issues not covered in this guide:
- Check GitHub Issues: [Link to your repo]/issues
- Join Discord: [Your Discord invite]
- Provide Details:
- Server console errors
- F8 console errors
- RedM version
- RSG-Core version
- Steps to reproduce
When Reporting Issues, Include:
- RedM Build: [e.g., 1436]
- RSG-Core Version: [e.g., 1.2.5]
- MySQL Version: [e.g., 8.0.33]
- Error Message: [full error from console]
- Reproduction Steps: [what you did before error occurred]
Before going live, verify:
- Database tables created successfully (5 tables: player_wounds, medical_treatments, player_infections, player_fractures, medical_history)
- Stored procedures created (2 procedures)
- Items added to rsg-core shared items
- Item images added to inventory folder
- Config.lua updated with correct job names
- Config.lua updated with correct coordinates
- Server starts without errors
-
/healand/revivecommands work - Medic job access to storage works
-
/inspectcommand opens NUI - Wounds track correctly when taking damage
- Treatments can be applied via NUI
- Infections progress when bandages expire
- Wounds heal to scars with proper treatment
- Training missions can be started
- No console errors during normal gameplay
Installation Complete!
Your QC-AdvancedMedic system is now ready for alpha testing. Monitor server console and player feedback for any issues.