{"hash":"0xA61C8FC6","ns":"CFX","name":"GET_PLAYER_IDENTIFIER_BY_TYPE","slug":"GET_PLAYER_IDENTIFIER_BY_TYPE","official":true,"named":true,"luaName":"GetPlayerIdentifierByType","game":"cfx","apiset":"server","returnType":"char*","params":[{"name":"playerSrc","type":"char*","description":"The player to get the identifier for"},{"name":"identifierType","type":"char*","description":"The string to match in an identifier, this can be `\"license\"` for example."}],"returnsDescription":"The identifier that matches the string provided","summary":"Get an identifier from a player by the type of the identifier.","descriptions":[{"source":"cfx","format":"md","body":"Get an identifier from a player by the type of the identifier.\nKnown [Identifiers](https://docs.fivem.net/docs/scripting-reference/runtimes/lua/functions/GetPlayerIdentifiers/#identifier-types)"}],"examples":[{"lang":"lua","code":"local playerLicenses = {}\n\nAddEventHandler('playerJoining', function()\n    playerLicenses[source] = GetPlayerIdentifierByType(source, 'license')\nend)","source":"cfx"},{"lang":"js","code":"let playerLicenses = {};\n\non('playerJoining', () => {\n    playerLicenses[source] = GetPlayerIdentifierByType(source, 'license');\n});","source":"cfx"},{"lang":"cs","code":"using System.Collections.Generic;\nusing static CitizenFX.Core.Native.API;\n// ...\n\n// In class\nprivate Dictionary<int, string> PlayerLicenses = new Dictionary<int, string>();\n\n// In class constructor\nEventHandlers[\"playerJoining\"] += new Action<Player>(SetLicense);\n\n// Delegate method\nprivate void SetLicense([FromSource]Player player) {\n    PlayerLicenses.Add(player.Handle, GetPlayerIdentifierByType(player.Handle, \"license\"));\n}","source":"cfx"}],"aliases":[],"enums":[],"related":[],"sources":["cfx"],"doc":3,"url":"https://natives.borderlinerp.com/natives/CFX/GET_PLAYER_IDENTIFIER_BY_TYPE","markdownUrl":"https://natives.borderlinerp.com/natives/CFX/GET_PLAYER_IDENTIFIER_BY_TYPE.md","snippets":{"lua":"local retval = GetPlayerIdentifierByType(playerSrc, identifierType)","luaInvoke":"local retval = Citizen.InvokeNative(0xa61c8fc6, playerSrc, identifierType, Citizen.ResultAsString())","js":"const retval = GetPlayerIdentifierByType(playerSrc, identifierType);","jsInvoke":"const retval = Citizen.invokeNative('0xa61c8fc6', playerSrc, identifierType, Citizen.returnResultAnyway(), Citizen.resultAsString());","csharp":"string retval = Function.Call<string>((Hash)0xa61c8fc6, playerSrc, identifierType);","notes":[]}}