Open
Description
What happened?
I tried using the GetVariantProp native but it always returns 0 for the three returned values (nameHash, enumValue, anchorPoint)
Expected result
Getting the actual prop variant
Reproduction steps
- Set Player's ped model to
mp_m_freemode_01
- Use this snippet and see the results
function GetAltPropVariationData(ped, propId)
local res = {}
local prop = 0
for prop=0, GetNumberOfPedPropDrawableVariations(ped, propId), 1 do
print(prop)
local propHashName = GetHashNameForProp(PlayerPedId(), propId, prop, 0)
local maxVariations = GetShopPedApparelVariantPropCount(propHashName)
if (maxVariations > 0) then
print("Got " .. maxVariations .. " variants")
for i = 1, maxVariations, 1 do
local nameHash --[[ Hash ]], enumValue --[[ integer ]], anchorPoint --[[ integer ]] = GetVariantProp(propHashName, i)
table.insert(res, {
initialProp = prop,
nameHash = nameHash,
enumValue = enumValue,
anchorPoint = anchorPoint
})
end
end
end
return json.encode(res)
end
return GetAltPropVariationData(PlayerPedId(), 0)
Importancy
Slight inconvenience
Area(s)
FiveM, Natives, ScRT: Lua
Specific version(s)
Tested in b3258 and b1604 - FXVersion 9823
Additional information
Note that the GetShopPedApparelVariantPropCount function works as sometimes, maxVariations is > 0 and the GetVariantProp is called