Nick78111 / ConnectQueue

Connection queue for FiveM
MIT License
77 stars 120 forks source link

How to send the amount of people queued to the bot #15

Open WerickARG opened 4 years ago

WerickARG commented 4 years ago

This is not an issue, but I need to know how to put the amount of people queued to apply it to this bot. If you know how I could include it, I would appreciate it. I have no knowledge of js so I do not, thanks.

I am trying to apply it in this bot: https://forum.cfx.re/t/release-fivem-discord-server-status-bot/809972

Use a system that looks for the var Queue but I can't think of to create that variable and link it with lua

Nick78111 commented 4 years ago

Simply add this to a manifest file

dependency "connectqueue"
server_script "@connectqueue/connectqueue.lua"

and put this in a server side script

CreateThread(function()
    while true do
        Wait(10000)
        if Queue.IsReady() then
            SetConvarServerInfo("Queue", "Queue Enabled | Count: " .. Queue.Exports:GetSize())
        end
    end
end)

It will update the queue count every 10 seconds

Nick78111 commented 4 years ago

One thing to note is that the queue commands will not work (if you even used them) because setting this convars name to Queue creates a conflict with the command prefix queue

WerickARG commented 4 years ago

Thank you very match, today i test it and i tell you if work