meta-hub / meta_target

A complete third eye solution for FiveM and RedM, aiming to proving all solutions from fivem-target, bt-target and qtarget under one resource.
21 stars 15 forks source link

no way to get entity handle #40

Closed minipunch closed 1 year ago

minipunch commented 1 year ago

is there no way to get the entity handle that you are targeting?

for the model one in particular

minipunch commented 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

Taavi-AU commented 1 year ago

yes, its possible, return the ent through targetData

Taavi-AU commented 1 year ago
print(json.encode(targetData, {indent=true})) 

and look what it prints, I believe ent is inside it

Taavi-AU commented 1 year ago
local function onSelect(targetData, itemData)
  print(json.encode(targetData, {indent=true})) 
end
minipunch commented 1 year ago

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

Taavi-AU commented 1 year ago

ah okay so itd be passed in a different arg