[Free] [Standalone/QB/ESX] fd-megaphones

fd-megaphones

This is a simple optimized FiveM megaphone script, this adds a handheld megaphone, a vehicle megaphone and static megaphones to objects which are specified in the config file.

For support just join our Discord.

Download

fd-megaphone

Dependencies

Installation - Standalone

  1. Download latest release
  2. Drag folder into server resources
  3. Edit the config as you please.

Installation - Framework

  1. Download latest release
  2. Drag folder into server resources
  3. In shared/config.lua specify either QB or QBox as instructed
  4. Add item-assets/megaphone.png to your inventorys item icons.
  5. Add items to framework.

QB -
Add to your qb-core/shared/items.lua

 megaphone                     = { name = 'megaphone', label = 'Megaphone', weight = 500, type = 'item', image = 'megaphone.png', unique = true, useable = true, shouldClose = true, description = 'A usable megaphone' },

QBox / ox_inventory -
Add to your ox_inventory/data/items.lua

["megaphone"] = {
    label = "Megaphone",
    weight = 500,
    stack = false,
    close = true,
    description = "A usable megaphone"
},

To use qb-target replace client/microphones.lua with the below code

local models = Config.models

Citizen.CreateThread(function()
    exports['qb-target']:AddTargetModel(models, { 
    options = { 
        { 
            icon = 'fa-solid fa-microphone', 
            label = 'Use Microphone', 
            action = function(entity)
                createMicPoly(GetEntityModel(entity))
            end,
        }
    },
    distance = 1,
    })
end)
4 Likes

Do you have ESX ?

Nice, any esx? xD

Will there be any support qb-target?

A preview showcasing all megaphone types would be dope!

Just a heads up. For esx you have as usable item bread instead of megaphone.
Here is changed one for people wondering whats going on

go to
server/framework.lua

elseif Config.framework == ‘esx’ then
ESX = exports[“es_extended”]:getSharedObject()

ESX.RegisterUsableItem('megaphone', function(playerId)
    local xPlayer = ESX.GetPlayerFromId(playerId)

    if xPlayer then
        TriggerClientEvent('fd-megaphones:client:usemegaphone', playerId)
    end
end)

end

Thank you, this has been corrected.

1 Like