Skip to main content

Overview

The Zyrix Admin API provides a powerful interface for programmatically managing your FiveM server. With over 40+ functions covering player management, moderation, vehicle control, staff tools, and server administration, you can build custom integrations and extend your server’s functionality.
All API functions include built-in permission checking and return consistent response patterns for reliable integration.

Quick Start

Basic Usage

-- Method 1: Direct exports (recommended)
local success, status = exports['zyrix_admin']:TeleportPlayer(staffId, targetId, coords)

-- Method 2: Full API object
local ZyrixAPI = exports['zyrix_admin']:GetAPI()
local success, status = ZyrixAPI.TeleportPlayer(staffId, targetId, coords)

Response Pattern

All API functions return a consistent tuple format:
local success, status, data = exports['zyrix_admin']:FunctionName(params)
  • success (boolean) - Whether the operation completed successfully
  • status (string) - Status code: ‘success’, ‘no_permission’, ‘invalid_target’, ‘player_not_found’, etc.
  • data (optional) - Additional data returned by specific functions

API Categories

🎮 Player Management

Control player positioning, health, and state with teleportation, healing, freezing, and revival functions.

⚖️ Moderation

Issue warnings, kicks, and bans with comprehensive logging and webhook integration.

🚗 Vehicle Management

Spawn, delete, repair, and manage vehicles with advanced customization options.

👁️ Staff Tools

Spectate players, enable noclip, control visibility, and access other administrative tools.

🖥️ Server Management

Take screenshots, make announcements, capture player snapshots, and control server restarts.

Permission System

All functions automatically check staff permissions based on your Zyrix configuration:
-- Example: Only staff with 'ban' permission can use BanPlayer
local success, status = exports['zyrix_admin']:BanPlayer(staffId, targetId, duration, reason)
-- Returns: success=false, status='no_permission' if insufficient permissions

Error Handling

Always check the success status and handle errors appropriately:
local success, status, data = exports['zyrix_admin']:TeleportPlayer(staffId, targetId, coords)

if not success then
    if status == 'no_permission' then
        print('Staff member lacks teleport permissions')
    elseif status == 'player_not_found' then
        print('Target player is not online')
    elseif status == 'invalid_target' then
        print('Invalid player ID provided')
    else
        print('Teleport failed:', status)
    end
    return
end

print('Player teleported successfully!')

Webhooks & Logging

Most administrative actions automatically trigger:
  • Discord webhook notifications (if configured)
  • Server console logging
  • Action history recording
These API functions perform real administrative actions on your server. Always validate permissions and input parameters before calling them in production environments.

Need Help?

  • Join our Discord for development support
  • Check the individual function documentation for detailed usage examples
  • Review the error handling section for troubleshooting common issues

Ready to get started? Choose a category from the sidebar to explore specific functions and see detailed code examples.