[Release][C#] FiveM Queue

Agree external launcher is not what im going for.

But with the right rcon commands or some sort of sql integration, you could add ppl to the queue from a website, and it would put them in to the queue, and if you could pull the estimated time either by rcon ex esttime steamid and get a reply you should be able to grab that.

Or if it saves to mysql let’s say once every 2-3 min and updates the est time for each player in the queue.

Think something like that could be quite cool to work on with out doubt, sadly i cant do C# only Lua and php haha :smiley:

Would definitly be a good helpful idea - “players that are accepted can click this [link] for a automatic whitelist”

however - my suggestion to this would be to make a nonSQL and a SQL version - ill be frank here, not the best with setting up DB’s - and it was hard enough to find a good whitelist

I downloaded the release. Extracted it and all.

Did you download earlier today and have the issue of a fivemqueue folder in your fivemqueue folder? Check that and also make sure your server version is at least 757. If you’re still having issues pm me your discord, I don’t want to violate the psa on release rules.

No, the script checks for hardcap and stops it if it is running.

Would you like me to do a quick test? we are maxed out almost 24/7

Hi @anders - great release.
My issue is that our servers is based of vRP which have handlers for connect.

Do you have any EventHandler when connection succeds in the queue system - so that I can bridge the two resources?

I have to give this shit a try.
Great work man!!!

Appreciate it if you do decide to test and have any feedback.

You can have a single use thread that triggers into VRP to let it know when a player first joins the server.

Citizen.CreateThread(function()
     while not NetworkIsPlayerActive(PlayerId()) do
          Citizen.Wait(0)
     end
     TriggerServerEvent("SomeVRPeventThatNeedsToKnowAboutNewPlayers")
     --Or TriggerEvent("IfVRPeventIsOnTheClientThatNeedsToKnow")
end)

There is an internal server event that gets triggered just like this on the fivemqueue client side to let the server know that the player is finished loading screen and in the game.

i think what he means is that his shitty vrp server uses deferrals as well

[edit] - Check my post below if you are using the original VRP for how to edit and make them compatible.

I could do that yes, but event would make more sense I guess?
Would remove the need for a thread. :slight_smile:

After doing more research actually nothing needs to change in VRP’s base.lua “playerConnecting” event handler. The problem is this function that runs in base.lua every 30 seconds and will drop the players that are in queue.

function task_timeout()
  local users = vRP.getUsers()
  for k,v in pairs(users) do
    if GetPlayerPing(v) <= 0 then
      vRP.kick(v,"[vRP] Ping timeout.")
      vRP.dropPlayer(v)
    end
  end

  SetTimeout(30000, task_timeout)
end
task_timeout()

So what you need to do is change the function instead to look like this and it appears these two resources are now compatible with each other. Checking for a null endpoint is actually a better way to see if players are still connected or not and the fivemqueue already takes care of dropping a player that gets frozen during the loading screen process which I feel this function was mainly included to catch.

function task_timeout()
  local users = vRP.getUsers()
  for k,v in pairs(users) do
    if GetPlayerPing(v) <= 0 and GetPlayerEndpoint(v) == null then
      vRP.kick(v,"[vRP] Ping timeout.")
      vRP.dropPlayer(v)
    end
  end

  SetTimeout(30000, task_timeout)
end
task_timeout()

Where did you find this code? I cannot find it in base.lua or vrp_mysql

resources/vrp/base.lua, line 419.

I installed it from here, is there another version I need to look at?

I use this source https://github.com/DunkoUK/dunko_vrp

Looks like in that version the whole looping ping timeout function is removed. I don’t see anything else immediately that would create any conflict with fivemqueue. I can install it though if you tell me it’s not working.

The queue system works besides 1-2 of my players cannot join, they just don’t spawn into the server else all other players can play on the server normally

That’s good to hear, what exactly is happening to those 1-2 players? Do they get dropped with this error “Froze during game load” or this error "“No Session Account Exists”? Are you getting any errors in the console that look like this? “[fivemqueue - ERROR] - …”?

I have the entire code wrapped in error catches to help with debugging so let me know.

Except the server supports multiple resources using deferrals, and will only complete when all deferrals are marked as done.