Sleepless Routing

sleepless_routing

Named routing buckets for FiveM. Give an instance a name, move a player into it, and read the result from replicated player state.

Features

  • Named buckets. Bucket 0 is the world, bucket 1 is hidden, and named buckets start at 2
  • Replicated player state: currentBucket, oldBucket, currentBucketName
  • Population and entity lockdown per bucket (inactive, relaxed, strict, no_dummy, full)
  • A player move brings their vehicle, the other players in it, and objects attached to their ped
  • getPlayersInBucket for whoever is in an instance right now
  • triggerClientEventForBucket sends one client event to those players through lib.triggerClientEvent
  • moveEntityToBucket for server-side vehicles, peds, and props
  • State stays in sync when another resource moves the player with SetPlayerRoutingBucket
  • Framework agnostic. No framework resource is required

Dependencies

Links

Other Releases

Code is accessible Yes
Subscription-based No
Lines (approximately) 460
Requirements ox_lib
Support Yes
1 Like

Fire as always partner!

– Dan

1 Like

Cool! Made something similar a while back for a server. One thing that you may want to consider is having server_only 'yes' in the fxmanifest and moving the shared files into server_scripts instead, allowing the resource to be server only. Should prevent the client from needing to download anything related to the resource.

Otherwise, nice to see that stuff like this get’s published for others to use!

Edit: formatting.

2 Likes

good call, consider it done

1 Like

can you explain this to me in simplistic terms lol does it stop the weird desync players get?

Its like for managing different layers/instances for players.