GetPedCollectionNameFromDrawable
Docslocal retval = GetPedCollectionNameFromDrawable(ped, componentId, drawableId)Description
Gets collection name for the given global drawable ID. Together with GET_PED_COLLECTION_LOCAL_INDEX_FROM_DRAWABLE is used to get collection and local index (inside the given collection) of the drawable. The collection name and index are used in functions like SET_PED_COLLECTION_COMPONENT_VARIATION.
Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The target ped |
componentId | int | One of the components from [SET_PED_COMPONENT_VARIATION](#\_0x262B14F48D29DE80) |
drawableId | int | Global drawable ID. Same as set in [SET_PED_COMPONENT_VARIATION](#\_0x262B14F48D29DE80). Global drawable ID points to drawables as if drawables 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()
-- Top for mp_f_freemode_01. From female_freemode_beach collection under index 1.
-- Global index is 17 because there is 16 top variations in the base game collection that goes before the female_freemode_beach collection.
local name = GetPedDrawableCollectionName(ped, 11, 17)
local index = GetPedDrawableCollectionLocalIndex(ped, 11, 17)
-- Equivalent to SetPedComponentVariation(ped, 11, 17, 0, 0)
SetPedCollectionComponentVariation(ped, 11, name, index, 0, 0)