Skip to content

Client Sync

File: client/sync.lua

Real-time group state synchronization between server and client.

Responsibilities

  • Receive group state updates from server
  • Send NUI messages to update React UI
  • Handle group lifecycle events (created, disbanded, joined, left)
  • Sync member lists, tasks, cooldowns, invites

Events Listened

EventNUI ActionDescription
wtf_group:client:groupSyncgroupSyncFull group state update
wtf_group:client:groupDisbandedgroupDisbandedGroup disbanded
wtf_group:client:inviteReceivedinviteReceivedInvite received
wtf_group:client:inviteAcceptedinviteAcceptedInvite accepted
wtf_group:client:inviteDeniedinviteDeniedInvite denied
wtf_group:client:cooldownSetcooldownSetCooldown activated
wtf_group:client:cooldownResultcooldownResultCooldown check result
wtf_group:client:taskCreatedtaskCreatedNew task created
wtf_group:client:taskActivatedtaskActivatedTask started
wtf_group:client:taskCompletedtaskCompletedTask completed
wtf_group:client:taskFailedtaskFailedTask failed
wtf_group:client:showInstructionshowInstructionShow instruction panel
wtf_group:client:hideInstructionhideInstructionHide instruction panel
wtf_group:client:repSyncrepSyncReputation update
wtf_group:client:levelUplevelUpGroup leveled up
wtf_group:client:dashboardSyncdashboardSyncDashboard data update
wtf_group:client:gpsSyncgpsSyncGPS/blip sync
wtf_group:client:gpsToggledgpsToggledGPS toggle state

Helper Functions

lua
GroupNotify(title, desc, type, duration)
-- Sends both ox_lib notification AND in-UI toast
-- type: 'inform', 'success', 'error', 'warning'

AIFAZI — FiveM Resources