J16D Posted October 17, 2017 Share Posted October 17, 2017 how to catch random ped, car or object with a LUA code?for example, in CLEO we can use this, const ped = [email protected] 0A8D: [email protected] = read_memory 0xB74490 size 4 virtual_protect 0000A: [email protected] += 0x40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0for [email protected] = 0 to 35584 step 0x100 0A8D: ped = read_memory [email protected] size 1 virtual_protect 0 000A: [email protected] += 0x1 if and 0029: ped >= 0x00 001B: 0x80 > ped then 005A: ped += [email protected] if and 056D: actor ped defined 803C: not $PLAYER_ACTOR == ped // (int) then /// do something with ped end endend and doing the same in LUA; local mem = readMemory(0xB74490, 4, false)mem = mem + 0x4mem = readMemory(mem, 4, false)local ifor i = 0, 0x8B00, 0x100 do local ped = readMemory(mem, 1, false) mem = mem + 1 if ped >= 0x0 and ped < 0x80 then ped = ped + i if doesCharExist(ped) and playerPed ~= ped and ped ~= nil then -- Do something with ped end endend it works fine ... but ... I do not know ... I think LUA must have another way of it, probably an easiest or better way ... Can someone help me with that? thanks .. Link to comment Share on other sites More sharing options...
GuruGuru Posted October 17, 2017 Share Posted October 17, 2017 table<Ped> chars = get_all_characters(float x, float y, float z, [float radius, bool skip_dead, bool sphere]) source cardboardbox1230 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now