Skip to content

Latest commit

ย 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MLeeM's Car Megaphone ๐Ÿš”๐Ÿ“ข

Lua Lint License: MIT FiveM Version

A powerful and optimized FiveM addon that enables police officers to use an in-vehicle megaphone system. Perfect for traffic stops, operations, and large-scale events with realistic audio effects and extensive customization options.

โœจ Features

  • ๐ŸŽค Enhanced Voice Range: Extends voice chat up to 75 meters while active
  • ๐Ÿ”ง Multi-Framework Support: ESX, QBCore, ox_core, and standalone mode with automatic detection
  • ๐Ÿš“ Smart Vehicle Detection: Job and vehicle-based permissions (configurable)
  • ๐Ÿ”Š Realistic Audio Effects: Optional audio submix for authentic megaphone sound
  • โŒจ๏ธ Flexible Controls: Customizable keybind with hold-to-talk functionality
  • โฑ๏ธ Anti-Spam Protection: Built-in cooldown system
  • ๐Ÿ’ก Visual Feedback: Optional vehicle light effects while active
  • ๐Ÿ“ Server Logging: Track all megaphone usage with detailed logs
  • ๐ŸŒ Multi-Language: Support for 9+ languages (EN, DE, FR, ES, IT, PT, RU, TR, PL)
  • ๐ŸŽฏ Optimized Performance: Minimal resource usage with dynamic thread management

๐Ÿ“‹ Requirements

Requirement Version Notes
FiveM Server Build 2545+ Recommended: Latest stable
pma-voice v6.6.2+ Download
Framework Optional ESX Legacy, QBCore, ox_core, or standalone
Game Build 2699+ For best compatibility

๐Ÿ“ฆ Installation

Step 1: Download

# Clone repository
git clone https://github.com/mleem97/mm_megaphone.git

# Or download latest release
# https://github.com/mleem97/mm_megaphone/releases/latest

Step 2: Install

  1. Copy the mm_megaphone folder to your server's resources directory
  2. Add to your server.cfg:
    ensure pma-voice
    ensure mm_megaphone
    

Step 3: Configure

  1. Navigate to config/config.lua
  2. Adjust settings to match your server setup
  3. Restart your server or run refresh and ensure mm_megaphone

โš™๏ธ Configuration

Basic Settings

-- Allowed Jobs
Config.AllowedJobs = { "police", "fib", "sheriff", "state", "immigration" }

-- Vehicle Restrictions
Config.AllowedVehicleClasses = { 18 }  -- 18 = Emergency Vehicles
Config.AllowedVehicleModels = { "police", "police2", "police3", "fbi", "sheriff" }

-- Megaphone Settings
Config.MegaphoneRange = 75.0           -- Voice range in meters
Config.Cooldown = 3000                 -- Cooldown in milliseconds
Config.UseVisualEffects = true         -- Flash vehicle lights
Config.UseSubmix = true                -- Enable megaphone audio effect

Keybind Configuration

Config.ActivationKey = 'NUMPAD7'  -- Default key (customizable in-game)

Available in FiveM Key Mapping:

  • Open: ESC > Settings > Key Bindings > FiveM
  • Search for: "Car Megaphone"
  • Assign your preferred key

Language Support

Config.Locale = 'en'  -- Available: en, de, fr, es, it, pt, ru, tr, pl

๐ŸŽฎ Usage

For Players

  1. Enter a police vehicle as an authorized officer
  2. Press and hold your configured megaphone key (default: NUMPAD7)
  3. Speak normally โ€“ your voice will be amplified to the configured range
  4. Release the key to return to normal voice range

For Server Owners

  • Monitor usage via server logs (logs/logs.lua)
  • Adjust range, cooldown, and effects in config/config.lua
  • Customize allowed jobs and vehicles per your server needs

๐Ÿ—๏ธ Project Structure

mm_megaphone/
โ”œโ”€โ”€ ๐Ÿ“ config/
โ”‚   โ””โ”€โ”€ config.lua          # Main configuration file
โ”œโ”€โ”€ ๐Ÿ“ bridge/
โ”‚   โ””โ”€โ”€ framework.lua       # Framework detection & integration
โ”œโ”€โ”€ ๐Ÿ“ client/
โ”‚   โ”œโ”€โ”€ main.lua           # Core client logic
โ”‚   โ””โ”€โ”€ submix.lua         # Audio effects system
โ”œโ”€โ”€ ๐Ÿ“ server/
โ”‚   โ””โ”€โ”€ main.lua           # Server-side events
โ”œโ”€โ”€ ๐Ÿ“ logs/
โ”‚   โ””โ”€โ”€ logs.lua           # Logging functionality
โ””โ”€โ”€ fxmanifest.lua         # Resource manifest

๐Ÿ”ง Advanced Configuration

Custom Audio Effects

Config.SubmixEffects = {
    defaultParam = 0,
    default = 0,
    freq_lowParam = 1,
    freq_low = 300.0,      -- Low frequency cutoff
    freq_hiParam = 2,
    freq_hi = 5000.0,      -- High frequency cutoff
    rm_mod_freqParam = 3,
    rm_mod_freq = 300.0,   -- Ring modulator frequency
    rm_mixParam = 4,
    rm_mix = 0.2           -- Effect mix level
}

Framework Integration

Config.EnableFrameworkIntegration = true  -- Disable for standalone mode

๐Ÿ› Troubleshooting

Common Issues

Problem: Megaphone doesn't activate

  • โœ… Ensure you're in an allowed vehicle
  • โœ… Check that your job is in Config.AllowedJobs
  • โœ… Verify pma-voice is running: ensure pma-voice
  • โœ… Check console for errors: F8 in-game

Problem: No audio effect

  • โœ… Set Config.UseSubmix = true in config
  • โœ… Restart the resource after config changes
  • โœ… Verify pma-voice version compatibility

Problem: Key doesn't work

  • โœ… Check FiveM Key Bindings settings
  • โœ… Try rebinding the key in-game
  • โœ… Ensure no other resource uses the same key

Problem: Works for everyone (no job restriction)

  • โœ… Verify framework is detected: Check server console
  • โœ… Ensure Config.EnableFrameworkIntegration = true
  • โœ… Confirm your framework is properly installed

Debug Mode

Enable verbose logging by adding this to server/main.lua:

Config.Debug = true  -- Add to config.lua

๐Ÿค Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ Changelog

Version 1.3.0 (2025-11)

  • โœจ Enhanced pma-voice v7.x compatibility
  • ๐Ÿ”ง Performance optimizations
  • ๐ŸŒ Extended language support
  • ๐Ÿ“ Improved documentation

Version 1.2.0 (2025-04)

  • โœจ Added visual effects
  • ๐Ÿ”ง Framework detection improvements
  • ๐Ÿ“ Enhanced logging system

View Full Changelog

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ’ฌ Support & Community

Note: Without an issue submission, bugs cannot be tracked or fixed. Please provide detailed reproduction steps!

โญ Show Your Support

If you find this resource helpful, please consider:

  • โญ Starring this repository
  • ๐Ÿ”„ Sharing it with your community
  • ๐Ÿ› Reporting bugs to help improve it

๐Ÿ‘จโ€๐Ÿ’ป About

Author: MLeeM
Created: 2025 (Freelance FiveM Development)
GitHub: @mleem97


Made with โค๏ธ for the FiveM Community

Report Bug ยท Request Feature ยท Documentation

About

A FiveM addon that lets police officers use a megaphone in vehicles. Increases voice range, supports ESX/QBCore/ox_core/standalone, includes optional audio effects, visual feedback, cooldown, and logging.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages