GetPedCollectionNameFromProp
Docslocal retval = GetPedCollectionNameFromProp(ped, anchorPoint, propIndex)Description
Gets collection name for the given global prop index. Together with GET_PED_COLLECTION_LOCAL_INDEX_FROM_PROP is used to get collection and local index (inside the given collection) of the prop. The collection name and index are used in functions like SET_PED_COLLECTION_PROP_INDEX.
Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The target ped |
anchorPoint | int | One of the anchor points from [SET_PED_PROP_INDEX](#\_0x93376B65A266EB5F) |
propIndex | int | Global prop index. Same as set by `drawableId` in [SET_PED_PROP_INDEX](#\_0x93376B65A266EB5F). Global prop index points to prop as if props from all collections for the given component are placed into one continuous array. |
Quick Snippet: Get Ped Handleped
pedUse this to get the player ped handle for this native.
-- Get the player's ped handle (client-side)
local ped = PlayerPedId()
print("Ped handle: " .. ped)
-- For a specific player's ped (server-side):
-- local targetPed = GetPlayerPed(source)Ped Models

mp_m_freemode_01
player_zero
ig_agatha
s_m_y_cop_01
s_m_m_gaffer_01
g_m_m_armboss_01
a_c_boar
a_m_m_bevhills_01Returns
char*Examples
Official
local ped = PlayerPedId()
-- Hat for mp_f_freemode_01. From female_freemode_beach collection under index 1.
-- Global index is 21 because there is 20 head prop variations in the base game collection that goes before the female_freemode_beach collection.
local name = GetPedPropCollectionName(ped, 0, 21)
local index = GetPedPropCollectionLocalIndex(ped, 0, 21)
-- Equivalent to SetPedPropIndex(ped, 0, 21, 0, false)
SetPedCollectionPropIndex(ped, 0, name, index, 0, false)