Help what might be the problem?

Vasadze

Member
Joined
Sep 22, 2024
Messages
10
Reaction score
0
im learning python, and im concerned how it works, all i get is x: 0.0 y: 0.0 z: 0.0 but id's and maxplayerid is correct, so i assume offsets are correct, what might be the problem? (I have 0.3.7 r1 version):
import pymem import pymem.process import struct # === Offsets for SAMP 0.3.7 R1 === samp_info_offset = 0x21A0F8 ppool_offset = 0x3CD player_pool_offset = 0x18 max_player_id_offset = 0x0 remoteplayer_offset = 0x2E remoteplayerdata_offset = 0x0 actor_offset = 0x0 gta_entity_offset = 0x44 # GTA entity position offsets pos_x_offset = 0x14 pos_y_offset = 0x18 pos_z_offset = 0x1C # === Main === pm = pymem.Pymem("gta_sa.exe") samp = pymem.process.module_from_name(pm.process_handle, "samp.dll").lpBaseOfDll samp_info = pm.read_int(samp + samp_info_offset) if not samp_info: print("samp_info not found") exit() samp_pools = pm.read_int(samp_info + ppool_offset) if not samp_pools: print("samp_pools not found") exit() player_pool = pm.read_int(samp_pools + player_pool_offset) if not player_pool: print("player_pool not found") exit() max_player_id = pm.read_int(player_pool + max_player_id_offset) print(f"Max Player ID: {max_player_id}") for player_id in range(0, max_player_id + 1): remote_player_ptr = player_pool + remoteplayer_offset + (player_id * 4) remote_player = pm.read_int(remote_player_ptr) if not remote_player: continue player_data = pm.read_int(remote_player + remoteplayerdata_offset) if not player_data: continue samp_actor = pm.read_int(player_data + actor_offset) if not samp_actor: continue gta_entity = pm.read_int(samp_actor + gta_entity_offset) if not gta_entity: continue try: x = pm.read_float(gta_entity + pos_x_offset) y = pm.read_float(gta_entity + pos_y_offset) z = pm.read_float(gta_entity + pos_z_offset) print(f"[{player_id}] Pos: X={x:.2f}, Y={y:.2f}, Z={z:.2f}") except: print(f"[{player_id}] Failed to read position")
 
Top