[Open Source] [QBCore] FiveM Pager System with Discord Integration

FiveM Pager

Pager for FiveM, with Discord and QBCore integration.

Github

Command

/page [channel] [message]

Message is limited to 63 characters

Config

For each channel, add a new key to the table:

["police"] = { -- Name of the channel, used on the command
        title = "Police", -- Title that displays on discord
        broadcastToJobs = { -- Ingame qb jobs that should receive pages from this channel (no job-check)
            ["police"]=true,
        },
        broadcastToRoles = nil, -- Uses pv-discord-uac; set to nil to ignore
        discordPermissions = nil, -- Uses pv-discord-uac; set to nil to ignore
        jobPermissions = { -- Jobs that can use /page for this channel
            "police"
        },
        webhooks = {
            ["https://discord.com/api/webhooks/901956847567590/LEtT9y8A7uQ3Ff34DqTPCNODWk2Xcz8rb042_ug055mjZNkgL7qvrUzDsxHmWRls"]="<@9189297405006602> new pager received!"
        }, -- Discord webhooks. Accepts multiple following structure "url"="message"
    }

Preview

image

6 Likes

wooow nice work can you make it work also with esx ?

Could you make this standalone aswell? This would be good for Fire and SWAT Deployments

1 Like

Sorry, I am just releasing previous made scripts, i am not actively developing for fivem anymore and also have never made a esx script before.

1 Like


how do i get the webhook working

The problem with making this fully standalone is limiting it for certain persons to use.

When this was used on the server i was a dev we had double validation - jobs and discord roles (with multi discord servers support), but that’s because we developed a script with a discord bot that would track roles. In the current release that discord roles control (pv-discord-uac) is not being made publicy available, so there’s only jobs as restrictions.

There are other pagers out there that are fully standalone, like the one made by inferno iirc.

Create your own webhook at your discord and paste the webhook from it in there

i have the Config.LogWebhook one works but not the other.
whats the @number for?

The <@number> is how you tag a role in discord. In that case the number is the role discord id.

The LogWebhook is where all pagers (regardless of settings) go to, for admin supervision (and it says who sent the pager).

Basically go and copy the role id you want to tag. when the webhook is sent it will tag everyone with that specific role

Is there away to set the pager up to firescript

Would it be possible to use Badger’s Discord scripts? I really like this pager system due to the UI.

hi i want to know if i do /page command it will show also for me or its only show other players ?

1 Like

It will send it to everyone who has one of the jobs in the broadcast config.

1 Like

I believe it is, you would just need to adjust the export (or in the extreme, make a new funciton).
I never used badger, but for example zdiscord as a similar export (isRolePresent): Exports | zdiscord

1 Like

Very cool

[ citizen-server-impl] Started resource pv-pager
[ script:pv-pager] SCRIPT ERROR: @pv-pager/server.lua:28: attempt to index a nil value (local ‘pagerTune’)
[ script:pv-pager] > ref (@qb-core/server/commands.lua:31)
[ script:qb-core] SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:479: attempt to concatenate a nil value (local ‘err’)

You are probably paging a channel that does not exist in the config.
I have just updated the code, since the validation wasn’t returning anything.

1 Like

its working good now thank you and good job its very nice

is there any way to make it so that u have to use the a item to send the page to some one? so that ist not a command but a actual item