Skip to main content

Introduction

The shared files in rsg-core contain all the core configuration data for your server including jobs, items, vehicles, gangs, weapons, and utility functions. These files are shared between client and server, making the data accessible on both sides without additional network calls. Location: resources/[framework]/rsg-core/shared/
Shared files are loaded on both client and server automatically. Changes require a server restart!

Core Features

๐Ÿ“ฆ Centralized Configuration

  • Jobs: Define all server jobs with grades and payments
  • Items: Configure inventory items with properties and metadata
  • Vehicles: Set up vehicle shops and pricing
  • Gangs: Create gang hierarchies and structures
  • Weapons: Define weapon properties and ammo types
  • Utilities: Helper functions for common operations

๐Ÿ”„ Shared Access

  • Client & Server: Data available on both sides
  • No Network Calls: Instant access without events
  • Consistent Data: Single source of truth
  • Easy Management: Edit in one place, affects everywhere

โš™๏ธ Flexible System

  • Add Custom Jobs: Create new job types
  • Define Items: Add new items with decay, quality, etc.
  • Vehicle Categories: Organize vehicles by type
  • Gang System: Set up gang hierarchies
  • Utility Functions: String manipulation, math helpers

Utility Functions

Location

File: rsg-core/shared/main.lua

Starter Items

Define default items for new players:
Customization:

String Functions

RandomStr

Generate random string of specified length:
Example:

RandomInt

Generate random number string:
Example:

SplitStr

Split string by delimiter:
Example:

Trim

Remove whitespace from string:
Example:

FirstToUpper

Capitalize first letter:
Example:

Round

Round number to decimal places:
Example:

Vehicle Functions

ChangeVehicleExtra

Toggle vehicle extras:
Example:

SetDefaultVehicleExtras

Set multiple vehicle extras:
Example:

Items Configuration

Location

File: rsg-core/shared/items.lua

Item Structure

Complete item definition with all properties:

Item Properties Reference

Item Type Examples

Consumable Food

Tools & Equipment

Money Items

Weapon Items

Items with Default Metadata


Jobs Configuration

Location

File: rsg-core/shared/jobs.lua

Job Structure

Complete job definition:

Job Properties

Grade Properties

Default Jobs

The framework includes these jobs by default: Law Enforcement (type = 'leo'):
  • vallaw - Valentine Law Enforcement
  • rholaw - Rhodes Law Enforcement
  • blklaw - Blackwater Law Enforcement
  • strlaw - Strawberry Law Enforcement
  • stdenlaw - Saint Denis Law Enforcement
Medical (type = 'medic'):
  • valmedic - Valentine Medic
  • sdmedic - Saint Denis Medic
Civilian:
  • unemployed - Default job for all players

Creating Custom Jobs


Vehicles Configuration

Location

File: rsg-core/shared/vehicles.lua

Vehicle Structure

Vehicle Properties

Vehicle Categories

Common categories:
  • 'horses' - Horse mounts
  • 'carts' - Wagons and carts
  • 'coaches' - Stagecoaches
  • 'boats' - Watercraft

Gangs Configuration

Location

File: rsg-core/shared/gangs.lua

Gang Structure

Default Gangs

  • none - No gang affiliation
  • odriscoll - Oโ€™Driscoll Boys
  • lemoyne - Lemoyne Raiders
  • murfree - Murfree Brood
  • skinner - Skinner Brothers
  • laramie - Laramie Gang
  • dellobo - Del Lobo Gang
  • night - Night Folk
  • foreman - Foreman Brothers
  • anderson - Anderson Boys
  • watson - Watsonโ€™s Boys

Creating Custom Gangs


Weapons Configuration

Location

File: rsg-core/shared/weapons.lua

Weapon Structure

Weapons must also be defined in shared/items.lua as inventory items with type = 'weapon'!

Best Practices

Restart Required: All shared file changes require a full server restart to take effect
Unique Keys: Ensure all items, jobs, and gangs have unique identifiers (names)
Test Thoroughly: Test all new jobs, items, and vehicles before deploying to production

Configuration Tips

  1. Consistent Naming: Use lowercase with underscores (my_custom_item)
  2. Clear Labels: Use descriptive display names
  3. Balanced Payments: Keep job payments balanced for economy
  4. Weight System: 1000g = 1kg, keep items realistic
  5. Image Files: Ensure all images exist in rsg-inventory/html/images

Common Mistakes

โŒ Donโ€™t:
โœ… Do:

Next Steps


Need help? Join the RSG Framework Discord!