Exports

This section describes all server exports in WX AntiCheat

WX AntiCheat includes a set of server side exports you can use from your own resources to interact with the AntiCheat or use it's already included functions outside of it.

Please note the exports format: exports["resourceName"]:exportName(...)

You can learn more about FiveM exports here

addAdmin

Registers a new admin by their identifier.

  • Parameters

    • identifier (string) → The player's network ID.
  • Example

  exports.wx_anticheat:addAdmin(123)

isAdmin

Checks if a player is registered as an admin.

  • Parameters

    • playerId (number) → The player’s server ID.
  • Returns

    • booleantrue if the player is an admin, otherwise false.
  • Example

  if exports.wx_anticheat:isAdmin(source) then  
    print("Player is an admin")  
  else  
    print("Player is not an admin")  
  end

removeAdmin

Removes a registered admin.

  • Parameters

    • identifier (number) → The player’s network ID.
  • Example

  exports.wx_anticheat:removeAdmin(123)

Ban Exports

banPlayer

Punishes the target player using the wx.detectionHandler option in config

  • Parameters

    • playerId (number) → The player’s server ID.
    • reason (reason) → Reason for the punishment
  • Example

  exports.wx_anticheat:banPlayer(1,"Suspicious Behaviour")

unbanPlayer

Removes a player ban from the database with the provided Ban ID

  • Parameters

    • banId (string) → The player’s Ban ID
  • Example

  exports.wx_anticheat:unbanPlayer("A78N-1LOQ")

Player Exports

getPlayerIdentifiers

Returns all of the player's current identifiers

  • Parameters

    • playerId (number) → The player’s server ID
  • Example

  local ids = exports.wx_anticheat:getPlayerIdentifiers(1)
  -- Returns:
  --[[
  {
    steam = "Not Found",
    ip = "Not Found",
    discord = "Not Found",
    license = "Not Found",
    fivem = "Not Found",
    xbox = "Not Found",
    live = "Not Found",
    license2 = "Not Found",
    playerName = GetPlayerName(playerID),
    hwid = {
        [1] = 123,
        [2] = 123,
        ...
      }
    }
  ]]


Whitelist Exports

whitelistPlayer

Temporarily or permanently whitelists a player.

  • Parameters

    • playerId (number) → The player’s server ID.
    • time (number) → Duration in miliseconds. Use -1 for permanent whitelist.
  • Example

  -- Whitelist player permanently  
  exports.wx_anticheat:whitelistPlayer(source, -1)  

  -- Whitelist player for 60 seconds  
  exports.wx_anticheat:whitelistPlayer(source, 60 * 1000)

removeWhitelist

Removes a player from the whitelist.

  • Parameters

    • playerId (number) → The player’s server ID.
  • Example

  exports.wx_anticheat:removeWhitelist(source)