Skip to content

Defer Events ​

FiniAC emits events during the player connection (deferral) process. These events allow you to integrate FiniAC with queue systems, custom connection handlers, or any logic that needs to run during the initial connection deferrals.

Why Use Defer Events? ​

Listening to FiniAC's defer events ensures that:

  • Your queue system only displays after FiniAC has verified the player
  • You avoid deferral message conflicts between FiniAC and your scripts
  • You can make decisions based on whether FiniAC allowed or rejected the connection
  • Your connection flow remains synchronized with FiniAC's security checks

Available Events ​

FiniAC:DeferStarted ​

Emitted when a player begins the connection verification process.

Parameters:

  • source (string): The temporary player source ID during connection

When it fires:

  • Immediately after the player begins connecting
  • Before any security checks are performed
  • Before the player receives a permanent source ID

FiniAC:DeferFinished ​

Emitted when FiniAC completes all connection verification checks.

Parameters:

  • source (string): The player source ID
  • joinAllowed (boolean): true if the player was allowed to join, false if they were rejected

When it fires:

  • After all security checks (bans, VPN, trust score, etc.)
  • After Terms of Service acceptance (if required)
  • Just before the player fully joins or gets kicked

Usage Examples ​

lua
-- Listen for when a player starts connecting
AddEventHandler("FiniAC:DeferStarted", function(source)
    print(("Player %s started FiniAC deferral"):format(source))
    -- Your queue logic can start here
end)

-- Listen for when FiniAC finishes verification
AddEventHandler("FiniAC:DeferFinished", function(source, joinAllowed)
    if joinAllowed then
        print(("Player %s passed FiniAC deferral"):format(source))
    else
        print(("Player %s was rejected by FiniAC"):format(source))
    end
end)
typescript
// Listen for when a player starts connecting
on("FiniAC:DeferStarted", (source: string) => {
  console.log(`Player ${source} started FiniAC deferral`);
  // Your queue logic can start here
});

// Listen for when FiniAC finishes verification
on("FiniAC:DeferFinished", (source: string, joinAllowed: boolean) => {
  if (joinAllowed) {
    console.log(`Player ${source} passed FiniAC deferral`);
  } else {
    console.log(`Player ${source} was rejected by FiniAC`);
  }
});

Best Practices ​

TIP

  • Only display your server's Terms of Service, rule acceptance, etc. deferrals after FiniAC:DeferFinished has fired.
  • Wait until FiniAC:DeferFinished before adding players to queue to avoid banned players taking up slots.