Closed minipunch closed 1 year ago
just wondering how I can get the player ID from a mp_m_freemode_01 ped I am looking at assuming it is a real player
yes, its possible, return the ent through targetData
print(json.encode(targetData, {indent=true}))
and look what it prints, I believe ent is inside it
local function onSelect(targetData, itemData)
print(json.encode(targetData, {indent=true}))
end
Yeah I didn't see anything in targetData
But I did get it with:
onSelect = function(a, b, entityHandle)
if DoesEntityExist(entityHandle) then
local serverId = GetPlayerServerId(NetworkGetPlayerIndexFromPed(entityHandle))
seems like the handle is passed as the last arg for me
ah okay so itd be passed in a different arg
is there no way to get the entity handle that you are targeting?
for the model one in particular