#define FUNC_CMessages__AddMessageJumpQ 0x69F1E0
#define FUNC_FindGroundZForCoord 0x569660
void AddMessageJumpQ(PCHAR text, UINT time, USHORT flag, bool bPreviousBrief) // Функция показа сообщения на экране.
{
((void(__cdecl *)(PCHAR, UINT, USHORT, bool))FUNC_CMessages__AddMessageJumpQ)(text, time, flag, bPreviousBrief);
}
float FindGroundZForPosition(float fX, float fY)
{
//DEBUG_TRACE("FLOAT CWorldSA::FindGroundZForPosition(FLOAT fX, FLOAT fY)");
DWORD dwFunc = FUNC_FindGroundZForCoord;
FLOAT fReturn = 0;
_asm
{
push fY
push fX
call dwFunc
fstp fReturn
add esp, 8
}
return fReturn;
}
void teleport(float posX, float posY, float posZ)
{
float *position = (*(DWORD *)0xB6F5F0) ? (float *)(*(DWORD *)(*(DWORD *)0xB6F5F0 + 0x14) + 0x30) : nullptr;
position[0] = posX;
position[1] = posY;
position[2] = posZ;
}
void teleport_target_blip()
{
if ((*(int *)0xBA6774 != 0))
{
float mapPos[3];
for (int i = 0; i < (0xAF * 0x28); i += 0x28)
{
if (*(short *)(0xBA873D + i) == 4611)
{
float *pos = (float *)(0xBA86F8 + 0x28 + i);
mapPos[0] = *pos;
mapPos[1] = *(pos + 1);
mapPos[2] = FindGroundZForPosition(mapPos[0], mapPos[1]) + 2.0f;
teleport(mapPos[0], mapPos[1], mapPos[2]);
}
}
}
else AddMessageJumpQ("~r~HA KAPTE HET METKU", 2000, NULL, false);
}