RedM Natives

LOAD_PLAYER_COMMERCE_DATA_EXT

Requests the commerce data from Tebex for the specified player, including the owned SKUs.

Hash0x7995539E
Runtime nameLoadPlayerCommerceDataExt
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

void LOAD_PLAYER_COMMERCE_DATA_EXT(char* playerSrc);

Parameters

NameTypeDescription
playerSrcchar*

The player handle

Returns void

Description

Cfx.re native reference

Requests the commerce data from Tebex for the specified player, including the owned SKUs.

Use IS_PLAYER_COMMERCE_INFO_LOADED_EXT 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.

Usage

Lua
LoadPlayerCommerceDataExt(playerSrc)

-- always works, by hash
Citizen.InvokeNative(0x7995539e, playerSrc)
JavaScript and C#
JavaScript
LoadPlayerCommerceDataExt(playerSrc);

// by hash
Citizen.invokeNative('0x7995539e', playerSrc);
C#
Function.Call((Hash)0x7995539e, playerSrc);

Examples

LUA · Cfx.re native reference
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)

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.