Kinetix AI Emote Creator for FiveM - Documentation
GitHubDiscord
  • 🖐️Introduction
  • 👀Overview
  • 🚀Get started
  • 👨‍💻Developer Portal
    • Game/App Space - Creation
    • Game/App Space - Settings
  • ⚙️Core
    • User Creation
    • Emote generation
    • Webhook
    • User bag
    • Sharing emote
    • Validation / Retake process
    • Paywalls
    • File download
    • Playing animations
  • 🖥️Interface
    • Events
      • Server
      • Client
    • Render functions
      • CreateRootMenu()
      • CreateQRCodeAlert(url)
      • CreateMainMenu()
      • CreateEmoteBagMenu(emotes)
      • OpenEmoteBagMenu()
      • CreateProcessValidationMenu(process)
      • CreateEmoteCreatorMenu(processes)
      • CreateErrorMenu(statusCode, error)
      • NotifyProcessUpdate(process)
      • NotifyEmoteReady(data)
      • CreateEmoteWheel(emotes)
  • 🔌Integrations
  • 🧪Live Demo
  • 📚Video recording Guidelines & AI Specs
    • AI Emote Creator - specifications
    • Video recording guidelines
Powered by GitBook
On this page
  • 1. Pre-Paywall Check (PaywallBefore)
  • 2. Post-Paywall Enforcement (PaywallAfter)
  • Practical Example for Monetization
  1. Core

Paywalls

To help server owners monetize the AI Emote Creator feature, the kinetix_mod provides two essential methods in the server/paywall.lua file: PaywallBefore and PaywallAfter. These functions enable you to implement checks and enforce payment conditions before and after emote creation.

1. Pre-Paywall Check (PaywallBefore)

This function is triggered before a player generates a QR Code for emote creation. It is where you add your paywall logic, such as checking the player’s balance or usage limit.

Here’s a breakdown:

-- Called before a QR Code request. Add your paywall conditions here
function PaywallBefore(userId, sourceId, callback)
    -- Example: Check player's balance (or other criteria)
    if CheckPlayerBalance(userId) then
        callback() -- Proceed with emote creation
    else
        -- If the player doesn't meet the paywall conditions, send an error
        TriggerClientEvent("paywall_error", sourceId, { 
            title = "Paywall limit", 
            description = "Insufficient funds" 
        })
    end
end

How It Works:

  • You will replace the logic inside CheckPlayerBalance(userId) with your actual code for checking the player’s balance or any other conditions (e.g., subscription tiers, token systems).

  • The callback() function is only called if the player passes the paywall check. If the player does not meet the conditions, do not call the callback() and send a client-side error with TriggerClientEvent instead.

  • The event "paywall_error" is sent to notify the player about paywall restrictions like insufficient funds.

2. Post-Paywall Enforcement (PaywallAfter)

This method is called after the emote generation process has been initiated. This is where you will implement the logic to deduct the player’s balance or track emote creation limits.

Code:

-- Called after a process has been launched. Store your paywall state here
function PaywallAfter(userId, payload)
    -- Example: Deduct the player's balance or increment monthly limit
    DeductPlayerBalance(userId, emotePrice)
end

Explanation:

  • This method is executed after the emote has been generated. You’ll typically use this function to deduct the appropriate currency from the player or track their emote generation usage (e.g., monthly limit).

  • Replace DeductPlayerBalance(userId, emotePrice) with your own balance deduction logic.

Practical Example for Monetization

Let’s say you want to charge 200 diamonds per emote generated. In PaywallBefore, you’d check if the player has at least 200 diamonds in their balance. If they do, callback() is called, allowing them to proceed with emote creation. If they don’t, an error message is sent.

In PaywallAfter, once the emote is created, the player’s balance is deducted by 200 diamonds.

PreviousValidation / Retake processNextFile download

Last updated 7 months ago

⚙️