Показать сообщение отдельно

  #5  
Старый 21.08.2025, 03:58
writeline
Новичок
Регистрация: 16.01.2022
Сообщений: 28
С нами: 2276608

Репутация: 8
По умолчанию

При запуске предлагает выбрать монитор и разрешение, как можно перехватить это окно выбора и изменить, картинку там добавить или текст какой то?

Через IDA смотрел не нашёл по strings ничего подобного.

Цитата:
Сообщение от daun.daunovich.01  

Пытаюсь получить координаты локального игрока в мире, но почему-то они постоянно 0.
Что не так?

cpp:





Код:
Это R3

CVector* pos = samp->getPos();
printf("x: %f, y: %f, z: %f\n", pos->x, pos->y, pos->z);

uintptr_t* getPlayerEntity() {
    uintptr_t player_pool = getPlayerPool();
    uintptr_t local_info = player_pool + 0x2F14;

    return reinterpret_cast(local_info + 0x2A4);
}

CVector* getPos() {
    uintptr_t* gamePed = getPlayerEntity();
    if (gamePed != nullptr) {
        return reinterpret_cast(0x4043A0)(gamePed);
    }

    //return CVector(1.0, 5.0, 10.0);
}

// 0x4043A0
CSimpleTransform *__thiscall CEntity::GetPosition(CEntity *this) - функция в IDA PRO

с++:





Код:
float
*
GetPlayerPositionPtr
(
)
{
DWORD playerPtr
=
*
(
DWORD
*
)
0xB6F5F0
;
if
(
!
playerPtr
)
return
nullptr
;
DWORD pedPtr
=
*
(
DWORD
*
)
(
playerPtr
+
0x14
)
;
if
(
!
pedPtr
)
return
nullptr
;
return
(
float
*
)
(
pedPtr
+
0x30
)
;
}
void
DrawCoordinates
(
)
{
float
*
position
=
GetPlayerPositionPtr
(
)
;
if
(
!
position
)
return
;
char
buffer
[
128
]
;
sprintf_s
(
buffer
,
"%.3f %.3f %.3f"
,
position
[
0
]
,
position
[
1
]
,
position
[
2
]
)
;
RECT textRect
=
{
0
}
;
pFontNormal
->
DrawTextA
(
NULL
,
buffer
,
-
1
,
&
textRect
,
DT_CALCRECT
|
DT_LEFT
,
0
)
;
int
xPos
=
viewport
.
Width
-
(
textRect
.
right
-
textRect
.
left
)
-
1
;
int
yPos
=
viewport
.
Height
-
(
textRect
.
bottom
-
textRect
.
top
)
-
1
;
RECT drawRect
=
{
xPos
,
yPos
,
xPos
+
(
textRect
.
right
-
textRect
.
left
)
,
yPos
+
(
textRect
.
bottom
-
textRect
.
top
)
}
;
DrawTextOutlined
(
pFontNormal
,
buffer
,
drawRect
,
COORDS_COLOR
,
SHADOW_COLOR
,
/*thickness=*/
1
)
;
}


Вырвал из клиента, мб чего то не будет хватать.

Но реализация рабочая.

 
Ответить с цитированием