Skip to content

GetPlayerIdentifierByType ​

сервер GET_PLAYER_IDENTIFIER_BY_TYPE

c
char* GET_PLAYER_IDENTIFIER_BY_TYPE(char* playerSrc, char* identifierType);

Get an identifier from a player by the type of the identifier. Known Identifiers

Параметры ​

  • playerSrc: The player to get the identifier for
  • identifierType: The string to match in an identifier, this can be "license" for example.

Возвращает ​

The identifier that matches the string provided

Примеры ​

lua
local playerLicenses = {}

AddEventHandler('playerJoining', function()
    playerLicenses[source] = GetPlayerIdentifierByType(source, 'license')
end)
js
let playerLicenses = {};

on('playerJoining', () => {
    playerLicenses[source] = GetPlayerIdentifierByType(source, 'license');
});
cs
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"));
}

Страница собрана автоматически из native-decls/GetPlayerIdentifierByType.md. Нашли ошибку — поправьте исходный файл.

Независимый проект на базе Cfx.re. Не связан с Rockstar Games и Take-Two Interactive.