[Need Help] About Player Pos and Sanny Builder Funcs - Defines

HomeTown

Новичок
Автор темы
14
1
Hello Guys,
I'm trying to get player position via ID. I looked some old cleos but there were used sampfuncs etc. How can i get player pos?
And is there any way to get sanny builder funcs address? Like a "00A0: store_actor $ PLAYER_ACTOR to ~ samp.dll + 0xblabla ~" ...
(I'm using 0.3DL version)
Thanks ..
 

HomeTown

Новичок
Автор темы
14
1
I can get my player id.
I looked up sobeit open source but generally used structure. like; pActor = g_Players->pRemotePlayer[iPlayerID]->pPlayerData->pSAMP_Actor->pGTA_Ped;
I can't found address. I want to get specific player id and position with pointers - address.
 

Vintik

Мечтатель
Проверенный
1,411
851
Hello Guys,
I'm trying to get player position via ID. I looked some old cleos but there were used sampfuncs etc. How can i get player pos?
And is there any way to get sanny builder funcs address? Like a "00A0: store_actor $ PLAYER_ACTOR to ~ samp.dll + 0xblabla ~" ...
(I'm using 0.3DL version)
Thanks ..
Hello. You need to get player char:
CLEO:
0B20: samp 1@ = actor_handle_by_samp_player_id 0@
After that you should get char coordinates:
CLEO:
00A0: store_actor 0@ position_to 1@ 2@ 3@

Also you can use function on some servers, if player outside stream zone:
 
  • Нравится
Реакции: HomeTown

HomeTown

Новичок
Автор темы
14
1
Hello. You need to get player char:
CLEO:
0B20: samp 1@ = actor_handle_by_samp_player_id 0@
After that you should get char coordinates:
CLEO:
00A0: store_actor 0@ position_to 1@ 2@ 3@

Also you can use function on some servers, if player outside stream zone:
Thanks for your answer but i have a problem. "0B20: samp 1@ = actor_handle_by_samp_player_id 0@" and "0B2F: samp get_streamed_out_player_pos 0@ to 1@ 2@ 3@" is using SampFuncs. In 0.3DL, i can't use this opcodes.
 

Vintik

Мечтатель
Проверенный
1,411
851
I know how to get position if you know player's char handle (also known as CPed):
CLEO:
// 0@ – should keep CPed
0A8E: 0@ = 0@ + 0x14
0A8D: 1@ = read_memory 0@ size 4 virtual_protect 1
0A8E: 1@ = 1@ + 0x30
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 1 // player's X coordinate
0A8E: 1@ = 1@ + 0x4
0A8D: 3@ = read_memory 1@ size 4 virtual_protect 1 // player's Y coordinate
0A8E: 1@ = 1@ + 0x4
0A8D: 4@ = read_memory 1@ size 4 virtual_protect 1 // player's Z coordinate
// 2@, 3@ and 4@ will have player's position
But how to get player's char handle if you know his SA-MP ID idk.
 
  • Нравится
Реакции: HomeTown

HomeTown

Новичок
Автор темы
14
1
I know how to get position if you know player's char handle (also known as CPed):
CLEO:
// 0@ – should keep CPed
0A8E: 0@ = 0@ + 0x14
0A8D: 1@ = read_memory 0@ size 4 virtual_protect 1
0A8E: 1@ = 1@ + 0x30
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 1 // player's X coordinate
0A8E: 1@ = 1@ + 0x4
0A8D: 3@ = read_memory 1@ size 4 virtual_protect 1 // player's Y coordinate
0A8E: 1@ = 1@ + 0x4
0A8D: 4@ = read_memory 1@ size 4 virtual_protect 1 // player's Z coordinate
// 2@, 3@ and 4@ will have player's position
But how to get player's char handle if you know his SA-MP ID idk.
Thanks for answer, i'm trying to do something. If i did it, i will write here. :)