Re: GTA2 memory addresses
Posted: 14 Jan 2018, 13:33
Nobody not is found a method to create an object/car/character? Or call spawn like in GTA3/VC/SA
Code: Select all
ped struct + 0x16C = car struct
car struct + 0x8 = [byte] front left light (set 64/0 on/off light, car struct + 0x8 = +4 left light crash decal)
car struct + 0xA = [byte] front right light (set 128/0 on/off light, car struct + 0x8 = +8 right light crash decal)
Thank you. References are useful.Sektor wrote:http://gtamp.com/GTA2/gta2arrows.ct
I meant it. http://projectcerbera.com/gta/2/tutorials/character-aiSektor wrote:No, I haven't found the arrows pointing location. I looked for it since it would be useful in GTA2 Radar but no luck.
Code: Select all
SET_CHAR_OBJECTIVE (name, OBJECTIVE_TYPE)
SET_CHAR_OBJECTIVE (name, OBJECTIVE_TYPE, X, Y, Z)
Code: Select all
car struct + 0x9C = [byte] engine state: 0 disabled, 1 off (set 2 engine and light off), 3 on (set 4 on engine and light)
car struct + 0x98 = [byte] door lock: 1 locked, 2 unlocked
car struct + 0x84 = [byte] car model: 0-86, 77 no moved (load handling from nyc.gci)
Сrash game and color is not displayed.BeepBoop wrote:I know the color of the car address for cheat engine.
"GTA2.EXE"+0027C274 (2 bytes)
Offset #1 = 0x24
Offset #2 = 0x50
Tell me if it works or not.
Code: Select all
0x5EB4FC = ped offset = ped offset + 0x4 = array ped pointer + 0xC4 = ped pointer = ped struct
ped struct + 0x16C = car pointer = car struct
car struct + 0x58 = sprite pointer = car sprite struct
Code: Select all
car struct + 0xA4 = [byte] emergy siren: 4 on, 2 off (in emergy cars)
car struct + 0xA7 = [byte] simulation button horn: 248 press (set 255), 0 up
car struct + 0x8E = [byte] signalisation sound: 1 on, 0 off
address + offset, but this is when the offset is needed. When do I need to get the pointer I'm using. method ofBeepBoop wrote:Can you use multiple offsets?
For Example: car struct + 0x24 + 0x50 = Current car color.
Code: Select all
while(true)
if (IsKeyDown(13)) then -- For write in MISI.log ped_struct and car_struct down key ENTER.
local address = tonumber("0x5EB4FC") -- Ped offset found by Sector
local offset = 0x4
local ped_ptr = ReadProcessMemory(address, 4)
ped_ptr = ped_ptr + offset
ped_ptr = ReadProcessMemory(ped_ptr, 4)
local ped_struct = ReadProcessMemory(ped_ptr + 0xC4, 4) -- Get struct ped ID 1 (it player 1)
if (ped_struct ~= 0) then -- Check player 1 exists
local car_struct = ReadProcessMemory(ped_struct + 0x16C, 4)
WriteInLog(string.format("Get ped struct %X car struct %X\n", ped_struct, car_struct))
end
end
wait(200)
end
Code: Select all
while(true)
if (IsKeyDown(13)) then -- Get color down key ENTER.
local address = tonumber("0x5EB4FC") -- Ped offset found by Sector
local offset = 0x4
local ped_ptr = ReadProcessMemory(address, 4)
ped_ptr = ped_ptr + offset
ped_ptr = ReadProcessMemory(ped_ptr, 4)
local ped_struct = ReadProcessMemory(ped_ptr + 0xC4, 4) -- Get struct ped ID 1 (it player 1)
if (ped_struct ~= 0) then -- Check player 1 exists
local car_struct = ReadProcessMemory(ped_struct + 0x16C, 4)
if (car_struct ~= 0) then -- Check car exists
local car_ptr = ReadProcessMemory(car_struct + 0x50, 4) -- Car color found by BeepBoop
local car_color = ReadProcessMemory(car_ptr + 0x24, 2)
WriteInLog(string.format("Get ped struct %X car struct %X car color %d\n", ped_struct, car_struct, car_color))
end
end
end
wait(200)
end
A pro manager can not be a speech that only works for manual tuning.BeepBoop wrote:I've found the music and effects volume addresses, but changing them doesn't do anything. You can change the radio/effects volume in the GTA 2 manager while in-game without having to restart.
Code: Select all
-- Since: v0.2.1b
function SetObjPos(obj, x, y, z)
local obj_ptr = ReadProcessMemory(obj + 0x4, 4)
WriteProcessMemory(obj_ptr + 0x14, x * 16384, 4)
WriteProcessMemory(obj_ptr + 0x18, y * 16384, 4)
WriteProcessMemory(obj_ptr + 0x1C, z * 16384, 4)
end
while (true) do
if (IsKeyDown(0x4)) then -- Down key middle mouse wheel
-- Here code create object or get obj struct
SetObjPos(obj, 10.0, 30.0, 5.0) -- Changed only z
end
end