GET_PLAYER_IDENTIFIER_BY_TYPE
Get an identifier from a player by the type of the identifier. Known [Identifiers](https://docs.fivem.net/docs/scripting-reference/runtimes/lua/functions/GetPlayerIdentifiers/#identifier-types)
CFX
Signature
lua
GetPlayerIdentifierByType(playerSrc, identifierType)
-- returns char*Parameters
| Name | Type | Description |
|---|---|---|
| char* | The player to get the identifier for | |
| char* | The string to match in an identifier, this can be `"license"` for example. |
Usage
Named call
GetPlayerIdentifierByType(playerSrc, identifierType)InvokeNative
Citizen.InvokeNative(0xA61C8FC6, playerSrc, identifierType)lua 1
local playerLicenses = {}
AddEventHandler('playerJoining', function()
playerLicenses[source] = GetPlayerIdentifierByType(source, 'license')
end)js 2
let playerLicenses = {};
on('playerJoining', () => {
playerLicenses[source] = GetPlayerIdentifierByType(source, 'license');
});cs 3
using System.Collections.Generic;
using static CitizenFX.Core.Native.API;
// ...
// In class
private Dictionary<int, string> PlayerLicenses = new Dictionary<int, string>();
// In class constructor
EventHandlers["playerJoining"] += new Action<Player>(SetLicense);
// Delegate method
private void SetLicense([FromSource]Player player) {
PlayerLicenses.Add(player.Handle, GetPlayerIdentifierByType(player.Handle, "license"));
}Details
- Hash
- API set
- Source
- cfx
Source: cfx
