Cops and Robbers ‐ FiveM Game Mode - Indom-hub/Cops-and-Robbers GitHub Wiki
Welcome to the Cops and Robbers game mode Wiki! This open-source FiveM game mode provides an immersive GTA V roleplay experience, focusing on the dynamic and strategic interaction between law enforcement and criminal factions. This guide will walk you through setting up, configuring, and managing the game mode.
- Overview
- Installation
- Gameplay Guide
- Controls and Keybinds
- Store and Inventory System
- Administrative Commands
- User Interface Guide
- File Structure
- Advanced Configuration Tips
- Command List
- Troubleshooting
- Contributing
- License
Cops and Robbers is designed for high-engagement roleplay servers on FiveM. Players are divided into three main roles:
- Cops: Tasked with arresting robbers, preventing crime, maintaining law and order in Los Santos, and using specialized equipment like spike strips and armor.
- Robbers: Responsible for executing heists, evading law enforcement, completing various criminal objectives, and managing illegal activities.
- Civilians: Can participate in the economy, banking system, and general roleplay activities without the restrictions of law enforcement or criminal roles.
- Dynamic Role System: Players can choose from Cop, Robber, or Civilian roles with unique abilities and restrictions
- Advanced Inventory System: Modern UI with category-based navigation and real-time item management
- Multiple Store Types: Cop stores, robber stores, gun shops, and general stores with role-specific access
- Banking & Heist System: Comprehensive financial system with bank robberies and economic gameplay
- Equipment Management: Weapon wheel integration, armor system, medical items, and cop-specific gear
- Administrative Tools: Extensive admin commands for server management and player control
- Crime Tracking: Wanted levels, pursuit mechanics, and law enforcement response systems
Ensure all required files are downloaded:
-
Core Scripts:
client.lua
,server.lua
,inventory_server.lua
,admin.lua
,config.lua
-
Manifest:
fxmanifest.lua
-
Web Interface:
html/index.html
,html/styles.css
,html/scripts.js
Place these files into a folder named Cops-and-Robbers
within your FiveM server's resources
directory.
In your server.cfg
file, add the following line:
ensure Cops-and-Robbers
This command activates the resource on server startup.
The manifest includes all necessary dependencies:
- NUI interface components
- All client and server scripts
- HTML, CSS, and JavaScript files
Modify config.lua
to adjust:
- Item prices and availability
- Store locations and types
- Role-specific restrictions
- Economic balance settings
- Administrative permissions
-
Accessing the Role Menu:
- Upon joining the server, players see a role selection interface
- Options include: Cop, Robber, and Civilian
- Each role has unique abilities, restrictions, and objectives
-
Role-Specific Features:
- Cops: Access to police equipment, spike strips, arrest mechanics, and law enforcement stores
- Robbers: Criminal activities, heist participation, and access to illegal goods
- Civilians: General gameplay, banking, shopping, and roleplay activities
NEW FEATURE: The inventory system now includes a modern, user-friendly interface accessible via the I
key.
-
Opening Inventory:
- Press
I
to open the inventory interface - Available for cops and robbers (civilians have limited access)
- Press
-
Inventory Features:
- Category Filtering: Filter items by type (All, Weapons, Armor, Utility, Medical, etc.)
- Item Management: Equip, use, or drop items with confirmation dialogs
- Equipment Panel: View currently equipped weapons and gear
- Real-time Updates: Inventory syncs automatically with game actions
-
Item Actions:
- Equip: Add weapons to weapon wheel or equip armor
- Use: Consume medical items, deploy spike strips, or activate special equipment
- Drop: Remove items from inventory with confirmation
Multiple store types are available throughout Los Santos:
-
Cop Stores:
- Located at police stations
- Sell law enforcement equipment, armor, weapons, and medical supplies
- Restricted to police officers only
-
Robber Stores:
- Hidden locations for criminal equipment
- Illegal weapons, lockpicks, and criminal tools
- Restricted to robbers only
-
Gun Shops:
- Public weapon stores (Ammu-Nation locations)
- Basic firearms and ammunition
- Available to all roles with restrictions
-
General Stores:
- Basic supplies and civilian items
- Food, drinks, and general equipment
- Open to all players
-
Bank Heists:
- Coordinated criminal activities with timer-based objectives
- Multiple bank locations with varying difficulty and rewards
- Team-based gameplay requiring planning and execution
-
Heist Timer System:
- Real-time countdown with visual HUD elements
- Automatic completion/failure based on timer expiration
- Dynamic police response based on heist progress
-
ATM Access:
- Deposit and withdraw money
- Account balance management
- Transaction history (if implemented)
-
Bank Interactions:
- Traditional banking services
- Targets for heist activities
- Economic gameplay elements
-
Wanted Levels:
- Dynamic wanted system based on criminal activities
- Police response scaling with crime severity
- Pursuit mechanics and escape scenarios
-
Arrest Mechanics:
- Police can arrest criminals
- Jail time and fine systems
- Release mechanisms and bail options
- I: Open/Close Player Inventory
- E: Interact with stores, ATMs, and objects
- ESC: Close any open UI interface
- ENTER: Confirm actions and selections
-
Cops:
- Access to spike strip deployment
- Arrest mechanics and handcuffs
- Police radio and communication systems
-
Robbers:
- Lockpicking interactions
- Heist-specific controls
- Criminal activity interfaces
- Mouse Navigation: Browse items and categories
- Click to Select: Choose items for purchase or sale
- Quantity Inputs: Adjust item amounts before transactions
- Tab Switching: Navigate between Buy and Sell interfaces
-
Store Locations:
- Marked on the map with appropriate icons
- Role-specific access controls
- Different store types for different purposes
-
Store Interface:
- Buy Tab: Purchase items with category filtering
- Sell Tab: Sell inventory items for cash
- Real-time price updates and inventory validation
The new inventory system provides comprehensive item management:
-
Inventory Categories:
- Weapons: Firearms, melee weapons, and ammunition
- Armor: Body armor, heavy armor, and protective gear
- Medical: Medkits, first aid kits, and healing items
- Utility: Tools, equipment, and special items
- Food/Drinks: Consumable items for health/hunger
-
Visual Interface:
- Grid-based layout with item icons
- Quantity indicators and item descriptions
- Equipment status and durability (if applicable)
-
Equipment System:
- Automatic weapon wheel integration
- Armor application and protection values
- Medical item consumption with health restoration
-
Special Items:
- Spike Strips: Deployable road hazards for cops
- Lockpicks: Breaking and entering tools for robbers
- Radio Equipment: Communication devices
- Evidence: Crime scene items and investigation tools
-
Weapon Management:
- Equip weapons to add them to the weapon wheel
- Ammunition tracking and reloading
- Weapon-specific attachments and modifications
-
Armor System:
- Body armor provides damage reduction
- Heavy armor for increased protection
- Armor degradation over time and damage
-
Medical System:
- First aid kits for minor healing
- Medkits for major health restoration
- Emergency medical supplies for critical situations
Comprehensive admin tools for server management:
Command | Description | Usage |
---|---|---|
/kick |
Remove a player from the server | /kick <playerID> |
/ban |
Permanently ban a player | /ban <playerID> |
/freeze |
Toggle player movement freeze | /freeze <playerID> |
/spectate |
Enter spectator mode for a player | /spectate <playerID> |
/teleport |
Teleport to a player's location | /teleport <playerID> |
Command | Description | Usage |
---|---|---|
/setcash |
Set a player's cash amount | /setcash <playerID> <amount> |
/addcash |
Add cash to a player's balance | /addcash <playerID> <amount> |
/removecash |
Remove cash from a player | /removecash <playerID> <amount> |
Command | Description | Usage |
---|---|---|
/setrole |
Assign a specific role to a player | /setrole <playerID> <role> |
/resetrole |
Reset player role to civilian | /resetrole <playerID> |
/giveitem |
Give items to a player | /giveitem <playerID> <item> <amount> |
/removeweapon |
Remove weapons from a player | /removeweapon <playerID> <weapon> |
/setinventory |
Set specific inventory quantities | /setinventory <playerID> <item> <amount> |
Command | Description | Usage |
---|---|---|
/heal |
Fully heal a player | /heal <playerID> |
/revive |
Revive a downed player | /revive <playerID> |
Command | Description | Usage |
---|---|---|
/startheist |
Initiate a bank heist event | /startheist <bank> |
/stopheist |
End the current heist | /stopheist |
- Clean, modern interface with role descriptions
- Visual role indicators and ability previews
- Confirmation dialogs for role changes
- Styled with responsive design principles
NEW: Complete inventory overhaul with modern design:
-
Main Interface:
- Tabbed category system for easy navigation
- Grid layout with item icons and quantities
- Search and filter capabilities
- Equipment panel showing active gear
-
Item Actions Panel:
- Context-sensitive action buttons
- Item descriptions and statistics
- Confirmation dialogs for important actions
- Real-time feedback and notifications
-
Buy Interface:
- Category-based item browsing
- Price display and quantity selection
- Purchase confirmation and validation
- Real-time cash balance updates
-
Sell Interface:
- Inventory item display with sell values
- Bulk selling options and quantity controls
- Transaction confirmation and processing
- Market value indicators
-
Heist Timer:
- Prominent countdown display
- Target location and objective information
- Progress indicators and status updates
-
Role Indicators:
- Current role display and status
- Wanted level indicators (for criminals)
- Health, armor, and cash displays
Cops-and-Robbers/
├── fxmanifest.lua # Resource manifest and dependencies
├── config.lua # Configuration settings and item definitions
├── client.lua # Client-side game logic and interactions
├── server.lua # Server-side player data and economy
├── inventory_server.lua # Inventory system server logic
├── admin.lua # Administrative commands and tools
├── html/
│ ├── index.html # Main UI interface
│ ├── styles.css # Interface styling and animations
│ └── scripts.js # Client-side UI logic and interactions
└── docs/
└── README.md # This documentation file
File | Purpose |
---|---|
fxmanifest.lua |
Resource configuration and dependency management |
config.lua |
Item definitions, prices, and gameplay settings |
client.lua |
Player interactions, UI management, and client events |
server.lua |
Player data management, economy, and server events |
inventory_server.lua |
Inventory system logic and item management |
admin.lua |
Administrative commands and server management tools |
html/index.html |
Main user interface and component structure |
html/styles.css |
UI styling, animations, and responsive design |
html/scripts.js |
Frontend logic, event handling, and UI interactions |
-
Item Pricing:
- Adjust prices in
config.lua
based on server economy - Consider role-specific pricing strategies
- Balance risk vs. reward for criminal activities
- Adjust prices in
-
Store Configuration:
- Customize store locations and access permissions
- Modify item availability by role and location
- Set up dynamic pricing systems
-
Role Permissions:
- Fine-tune role-specific abilities and restrictions
- Customize equipment access by role
- Adjust crime and punishment systems
-
Inventory Management:
- Configure item stack sizes and limits
- Set up item durability and degradation
- Customize equipment effects and bonuses
-
Server Resources:
- Monitor inventory sync frequency
- Optimize UI update intervals
- Configure appropriate player limits
-
Client Performance:
- Adjust UI render distance and quality
- Optimize texture loading and caching
- Configure appropriate graphics settings
Command | Arguments | Purpose |
---|---|---|
/startheist |
<bank> |
Start a heist at specified bank location |
/stopheist |
None | Stop the current heist event |
/setrole |
<playerID> <role> |
Assign cop/robber/civilian role |
/giveitem |
<playerID> <item> <amount> |
Give items to players |
/setcash |
<playerID> <amount> |
Set player cash amount |
Command | Arguments | Purpose |
---|---|---|
/inventory |
None | Open inventory interface (alternative to I key) |
/balance |
None | Check current cash balance |
/role |
None | Display current role and status |
-
Inventory Not Opening:
- Ensure player has cop or robber role
- Check for UI focus conflicts with other resources
- Verify
I
key is not bound to other functions - Restart the resource if inventory becomes unresponsive
-
Store Access Problems:
- Verify player role permissions
- Check store location coordinates
- Ensure proper role assignment
- Confirm store type matches player role requirements
-
Item Functionality Issues:
- Weapons not appearing in weapon wheel after equipping
- Medical items not providing health restoration
- Armor not applying protection values
- Spike strips not deploying properly
-
Performance Issues:
- High server lag during inventory operations
- UI rendering slowly or inconsistently
- Memory usage increasing over time
-
Permission Issues:
-- Check player role assignment /setrole [playerID] [cop/robber/civilian]
-
Resource Conflicts:
- Disable conflicting inventory resources
- Check for duplicate keybind assignments
- Verify ESX compatibility settings
-
Database Problems:
- Ensure proper database permissions
- Check inventory table structure
- Verify player data synchronization
We welcome contributions from the community!
-
Code Standards:
- Follow Lua best practices
- Use consistent naming conventions
- Include comprehensive comments
- Test thoroughly before submission
-
Feature Development:
- Create feature branches for new development
- Maintain backward compatibility when possible
- Document new features and changes
- Include configuration options for customization
-
Bug Reports:
- Provide detailed reproduction steps
- Include server logs and error messages
- Specify FiveM versions
- Test with minimal resource conflicts
- Fork the repository on GitHub
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Commit your changes:
git commit -am "Description of changes"
-
Push to your branch:
git push origin feature/your-feature-name
- Create a pull request with detailed description of changes
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
- ✅ Commercial use allowed
- ✅ Modification and distribution permitted
- ✅ Private use allowed
- ❗ Source code must remain open
- ❗ Same license must be used for derivatives
- ❗ Copyright and license notices must be preserved
Thank you for using Cops and Robbers!
- 🐛 Bug Reports: GitHub Issues
- 💬 Community Support: Discord Server
- 📖 Documentation: This wiki and inline code comments
- 🔧 Feature Requests: GitHub Issues with enhancement label
- ⭐ Star the repository to show support
- 👀 Watch for updates and new releases
- 🔄 Follow development in the Discord community
- 📢 Share feedback to help improve the gamemode
Version: 1.2.0 | Last Updated: June 2025 | FiveM Compatibility: Latest