LOAD_PLAYER_COMMERCE_DATA_EXT
Requests the commerce data from Tebex for the specified player, including the owned SKUs.
Signature
void LOAD_PLAYER_COMMERCE_DATA_EXT(char* playerSrc);Parameters
| Name | Type | Description |
|---|---|---|
playerSrc | char* | The player handle |
Returns void
Description
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
LoadPlayerCommerceDataExt(playerSrc)
-- always works, by hash
Citizen.InvokeNative(0x7995539e, playerSrc)JavaScript and C#
LoadPlayerCommerceDataExt(playerSrc);
// by hash
Citizen.invokeNative('0x7995539e', playerSrc);Function.Call((Hash)0x7995539e, playerSrc);Examples
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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.