GithubHelp home page GithubHelp logo

connectqueue's Introduction

ConnectQueue


Easy to use queue system for FiveM with:

  • Simple API
  • Priority System
  • Config
    • Ability for whitelist only
    • Require steam
    • Language options

Please report any bugs on the release thread Here or through GitHub.

How to install


  • Drop the folder inside your resources folder.
  • Add start connectqueue inside your server.cfg. - Preferrably at the top
  • Set convars to your liking.
  • Open connectqueue/server/sv_queue_config.lua and edit to your liking.
  • Renaming the resource may cause problems.

ConVars


set sv_debugqueue true # prints debug messages to console
set sv_displayqueue true # shows queue count in the server name '[count] server name'

How to use / Examples


To use the API add server_script "@connectqueue/connectqueue.lua" at the top of the __resource.lua file in question. I would also suggest adding dependency "connectqueue" to it aswell. You may now use any of the functions below, anywhere in that resource.

OnReady

This is called when the queue functions are ready to be used.

    Queue.OnReady(function() 
        print("HI")
    end)

All of the functions below must be called AFTER the queue is ready.

OnJoin

This is called when a player tries to join the server. Calling allow with no arguments will let them through. Calling allow with a string will prevent them from joining with the given message. allow must be called or the player will hang on connecting...

Queue.OnJoin(function(source, allow)
    allow("No, you can't join")
end)

AddPriority

Call this to add an identifier to the priority list. The integer is how much power they have over other users with priority. This function can take a table of ids or individually.

-- individual
Queue.AddPriority("STEAM_0:1:33459672", 100)
Queue.AddPriority("steam:110000103fd1bb1", 10)
Queue.AddPriority("ip:127.0.0.1", 25)

-- table
local prioritize = {
    ["STEAM_0:1:33459672"] = 100,
    ["steam:110000103fd1bb1"] = 10,
    ["ip:127.0.0.1"] = 25,
}
Queue.AddPriority(prioritize)

RemovePriority

Removes priority from a user.

Queue.RemovePriority("STEAM_0:1:33459672")

IsReady

Will return whether or not the queue's exports are ready to be called.

print(Queue.IsReady())

Other Queue Functions

You can call every queue function within sh_queue.lua.

local ids = Queue.Exports:GetIds(src)

-- sets the player to position 1 in queue
Queue.Exports:SetPos(ids, 1)
-- returns whether or not the player has any priority
Queue.Exports:IsPriority(ids)
--- returns size of queue
Queue.Exports:GetSize()
-- plus many more...

connectqueue's People

Contributors

nick78111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

connectqueue's Issues

Freezing

After some time of being in the queue, the queue freezes (dots stop moving) and the client won't connect. Rejoining the queue fixes this.

Steam authentication failure

Gives error when i set Steam to true and still have steam running!:
Connection rejected by server: โ— [Queue] Error: Steam must be running
This is a Steam authentication failure, but you are running Steam and it is signed in. The server owner can find more information in their server console.

Error whe i use Queue.Exports.SetPos()

Screenshot_6

Hey, man! I try create Command for admins /priority STEAMID POSITION for manual priority in Queue. I using Queue.Exports:SetPos('steam:xxxxxxxx', position[int]) and i obtain this error. Can you help me ?

Ty a lot this addon is a TOP!

Not queueing

Ive got everything set to 64, it disables the hardcap, but instead of queueing players it just lets them join passed 64? also lets them join without steam when ive got that function set to true.

shared sh_queue.lua error

SCRIPT ERROR: @connectqueue/shared/sh_queue.lua:492: attempt to concatenate a nil value (local 'name')

how to fix this latest version of server nothing changed

Changes server title

i was curious why my server was named "Deafult FX Server" so i went through and stopped every rescource one by one and once i stopped connectqueue my title showed back up properly?

No such export GetQueueExports in resource connectqueue

Hello, I've had this issue for some weeks now, when the server starts it will say this:

SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:924: No such export GetQueueExports in resource connectqueue

I've deleted cache & reinstalled to no luck. Please Help ๐Ÿ‘

Queue Freezes all.

Sometimes there is 26/32 player and queue stop moving.

I have sometimes 100ppls in queue :(

Script deadloop

script deadloop

This error happens whenever i put in any discord queue idk what is causing it ?

[Feature Request] Queue waiting time

Any chance we could get a time waiting feature implemented?

I.e. someone joins in at 50 priority but if they've been waiting for x amount of time so they will jump up x amount of priority? Even if it's just increments of 1 every 15 minutes or something.

sh_queue.lua:382 Exports()

So apparently I'm having a error with the global exports() on line 382.

lua Error loading script shared/sh_queue.lua in resource connectqueue: shared/sh_queue.lua:382: attempt to call a table value (global 'exports') stack traceback: shared/sh_queue.lua:382: in main chunk Failed to load script shared/sh_queue.lua.x

Line 382

lua exports("Exports", function() return Queue end)

Cant get priority to work.

Hi.

Great script, but i cant seem to get the priority to work?
Could you update your readme on how to add the priority's?

Menu Keeps dissapearing

Anyone know how to fix the menu from disappearing after a vehicle doesn't like or something that wasn't placed right? Did anyone make this work consistently?

License Request

While the last update was a while ago, I hope you are still around to review this request.

I am asking if you could please place this under an MIT license so I can bundle this in with my modifications for my Framework.
If not, still hoping you can pop another license on it so I can include sections and modify the rest.

Warmest regards,
T

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.