πŸ‘ΎUsage

This page contains details on how to use script APIs.

Exports

Server-Side Exports

getPlayerSubscriptions

This export can be used if you want to retrieve all subscriptions of the target player.

// Usage example
RegisterNetEvent("exampleEvent", function()
   local Player = Framework.Functions.GetPlayer(source)
   local currentSubscriptions = exports['cfx-praryo-subscriptions']:getPlayerSubscriptions(Player.PlayerData.source)
	
   print(json.encode(currentSubscriptions, {
     indent = true
   }))
end)

// Output (Array): {"level_1", "level_2"}
// level_1, level_2 comes from the Config.Subscriptions index.

hasPlayerSubscription

This export can be used to determine whether a player has a specific subscription.

addPlayerSubscription

This export can be used to add pending subscriptions using your scripts.

removePlayerSubscription

This export can be used to remove subscriptions using your scripts.

Client-Side Exports

getPlayerSubscriptions

This export can be used if you want to retrieve all subscriptions of the target player.

hasPlayerSubscription

This export can be used to determine whether a player has a specific subscription.

Events

Server-Side Events

Usage:

Example:

Client-Side Events

Usage:

Example:

Last updated