Skip to main content
All exports are server-side only and cannot be called from client-side scripts

Available Exports

CreateRealID

Creates a real ID card for the specified player.
exports['revo_idcard']:CreateRealID(playerSource)
Parameters:
  • playerSource (number): The player’s server ID

CreateDriverLicense

Creates a driver license for the specified player.
exports['revo_idcard']:CreateDriverLicense(playerSource)
Parameters:
  • playerSource (number): The player’s server ID

CreateWeaponLicense

Creates a weapon license for the specified player.
exports['revo_idcard']:CreateWeaponLicense(playerSource)
Parameters:
  • playerSource (number): The player’s server ID

Integration Example

Admin Command Example

Here’s a complete example of an admin command that gives a driver license to a player:
-- Command to give driver license to a player
RegisterCommand('givelicense', function(source, args, rawCommand)
    local playerId = tonumber(args[1])
    
    if not playerId or playerId <= 0 then
        print("^1[DEBUG] Invalid player ID: " .. tostring(playerId) .. "^0")
        TriggerClientEvent('chat:addMessage', source, {
            color = {255, 0, 0},
            multiline = true,
            args = {"System", "Usage: /givelicense [player_id]"}
        })
        return
    end
    
    local playerName = GetPlayerName(playerId)    
    if not playerName then
        print("^1[DEBUG] Player not found for ID: " .. playerId .. "^0")
        TriggerClientEvent('chat:addMessage', source, {
            color = {255, 0, 0},
            multiline = true,
            args = {"System", "Player not found!"}
        })
        return
    end

    -- Create driver license using the export
    exports['revo_idcard']:CreateDriverLicense(playerId)
    
    TriggerClientEvent('chat:addMessage', source, {
        color = {0, 255, 0},
        multiline = true,
        args = {"System", "Driver License given to " .. playerName}
    })
    
end, false)
This example shows:
  • Proper argument validation
  • Debug logging for troubleshooting
  • Error handling for invalid inputs
  • Using the export to create the license
  • Feedback to admin and target player (from ID Card script)

How Exports Work

The exports trigger a client-side event that initiates the mugshot capture and ID card creation process. The system works asynchronously through a client-server communication flow. Complete flow when you call an export:
  1. Export called → Triggers revo_idcard:requestMugshotAndCreateID client event
  2. Client-side → Handles mugshot capture and sends data back via revo_idcard:receiveMugshotAndCreateID
  3. Server-side → Receives mugshot data and triggers revo_idcard:issueRealID event
  4. Final creationissueRealID handles player data fetching and actual item creation
The exports are fire-and-forget - they start the process but don’t provide immediate feedback. Success/failure is handled through the internal event system.

Notes

  • The player must have sufficient inventory space for the card to be created
  • Cards are created with default settings as configured in the main config file
  • These exports work with all supported inventory systems (ox_inventory, qb-inventory, qs-inventory)
I