Skip to content

Conversation

@Klaus-Michealson
Copy link

@Klaus-Michealson Klaus-Michealson commented Nov 10, 2025

Updated Discord presence handling to include player count and player name.

Description

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

Updated Discord presence handling to include player count and player name.
end
end)

RegisterNetEvent('discord:updatePresence', function(currentCount)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a function rather than an event.

Comment on lines +32 to +35
CreateThread(function()
Wait(5000)
TriggerEvent('discord:updatePresence', GlobalState.PlayerCount or 0)
end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for? Why are we waiting 5 seconds?

@@ -1,18 +1,35 @@
local maxPlayers = GlobalState.MaxPlayers
local maxPlayers = GlobalState.MaxPlayers or GetConvarInt('sv_maxclients', 64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants