Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for spectating for servers with buckets #820

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

Gravxd
Copy link
Contributor

@Gravxd Gravxd commented Jan 26, 2024

Lots of servers use buckets (if you don't, try it!) - this addresses and provides a solution to #788

  • When pressing "spectate", the server will check your bucket against the target, if they are not the same, it will set yours (the admin) to the bucket of the target player but will also have your client cache the original bucket you were in when beginning your spectate.
  • Every 5 seconds whilst spectating, your client will check if the target player's ped still exists, if it doesn't (sign of them changing) it will ask the server to confirm and again make the necessary bucket change. This means that if that player changes lobbies multiple times, it will continue to work. (small delay for optimisation)
  • When you exit the spectator mode, it will restore you to the original bucket that you cached originally meaning you can continue your gameplay

@@ -172,7 +172,7 @@ RegisterServerEvent("EasyAdmin:GetInfinityPlayerList", function()
for i, v in pairs(cached.identifiers) do
if v == "discord:178889658128793600" then
pData.developer = true
elseif v == "discord:736521574383091722" --[[ Jaccosf ]] or v == "discord:1001065851790839828" --[[ robbybaseplate ]] or v == "discord:840695262460641311" --[[ Knight ]] or v == "discord:270731163822325770" --[[ Skypo ]] or v == "discord:186980021850734592" --[[ coleminer0112 ]] then
elseif v == "discord:736521574383091722" --[[ Jaccosf ]] or v == "discord:1001065851790839828" --[[ robbybaseplate ]] or v == "discord:840695262460641311" --[[ Knight ]] or v == "discord:270731163822325770" --[[ Skypo ]] or v == "discord:186980021850734592" --[[ coleminer0112 ]] or v == 'discord:469916940710707231' --[[ Grav ]] then
Copy link
Owner

Choose a reason for hiding this comment

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

sneaky, lol.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not intended to be haha, thought that was the norm after the last release included one my request as well 😅

@Blumlaut Blumlaut linked an issue Jan 26, 2024 that may be closed by this pull request
@Blumlaut
Copy link
Owner

looks good! thank you for your contribution

@Blumlaut Blumlaut merged commit 59a67bc into Blumlaut:master Jan 26, 2024
1 check failed
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.

[BUG] Spectate when different buckets
2 participants