RedM Index logoRedM Index
NativesHashesClothesBlipsPropsItem Tool
Sign inGet started

Reference

  • Natives
  • Hashes
  • Clothes
  • Blips
  • Props

Namespace

  1. Reference
  2. Natives
  3. LOAD_PLAYER_COMMERCE_DATA_EXT

LOAD_PLAYER_COMMERCE_DATA_EXT

Requests the commerce data from Tebex for the specified player, including the owned SKUs. Use [`IS_PLAYER_COMMERCE_INFO_LOADED_EXT`](#\_0x1D14F4FE) to check if it has loaded. This will not automatically update whenever a client purchases a package, if you want to fetch new purchases you will need to call this native again. This native will temporarily cache the players commerce data for 10 seconds, a call to this native after 10 seconds will re-fetch the players commerce data.

CFX

Signature

lua
LoadPlayerCommerceDataExt(playerSrc)
-- returns void

Parameters

NameTypeDescription
char*The player handle

Usage

Named call
LoadPlayerCommerceDataExt(playerSrc)
InvokeNative
Citizen.InvokeNative(0x7995539E, playerSrc)
lua 1
RegisterNetEvent("doesOwnPackage", function(packageIdSku)
	-- source isn't valid across waits, so we localize it
	local source = source

	-- input isn't right
	if type(packageIdSku) ~= "number" then
		return
	end

	-- The native will cache the results
	LoadPlayerCommerceDataExt(source)
	-- Wait for the players data to load
	while not IsPlayerCommerceInfoLoadedExt(source) do
		Wait(0)
	end

	-- Tell the client if they own the package or not
	TriggerClientEvent("doesOwnPackage", source, DoesPlayerOwnSkuExt(source, packageIdSku))
end)

Details

Hash
API set
Source
cfx

Source: cfx

On this page

  • Signature
  • Parameters
  • Usage
  • Details