Другое С/С++ Вопрос - Ответ

kin4stat

mq-team
Всефорумный модератор
2,731
4,693
сам не найдешь в инете
Да ты что!
1655571255864.png
 

bottom_text

Известный
675
317
  • Нравится
Реакции: !Sam#0235

horacy

Известный
102
92
как вычислить квантерион другого игрока (x, y, z, w) или как вычислить квантерион игрока по градусам поворота?

А может есть возможность скопировать весь ID_PLAYER_SYNC другого игрока?
 
Последнее редактирование:

Savchik Blazer

Но я, мечту свою лелея...
Проверенный
672
292
Есть ли в c++ аналог memory.tostring из луа ( тоесть чтение строки памяти)
 

kin4stat

mq-team
Всефорумный модератор
2,731
4,693
Есть ли в c++ аналог memory.tostring из луа ( тоесть чтение строки памяти)
C-Style string view:
C++:
const char* str = reinterpret_cast<const char*>(address);
string-view:
C++:
std::string_view str{reinterpret_cast<const char*>(address)/*, [optional] size*/};
string copy:
C++:
std::string str{reinterpret_cast<const char*>(address)/*, [optional] size*/};
 
  • Нравится
Реакции: MeG@LaDo[N] ^_^

kin4stat

mq-team
Всефорумный модератор
2,731
4,693
If I can get both values that would be great, if not enough with string hex color
C++:
ImVec4 color{};

// ImGui::ColorEdit

unsigned long u32_color = IM_COL32(color.x, color.y, color.z, color.w);
// or
auto u32_color = ImGui::ColorConvertFloat4ToU32(color);

convert to hex string:
C++:
std::string str_color{};
str_color.reserve(8); // SSO is used, there isn't allocation. Just in case

std::to_chars(str_color.data(), str_color.data() + str_color.capacity(), u32_color, 16);
 
  • Влюблен
Реакции: !Sam#0235

Savchik Blazer

Но я, мечту свою лелея...
Проверенный
672
292
C-Style string view:
C++:
const char* str = reinterpret_cast<const char*>(address);
string-view:
C++:
std::string_view str{reinterpret_cast<const char*>(address)/*, [optional] size*/};
string copy:
C++:
std::string str{reinterpret_cast<const char*>(address)/*, [optional] size*/};
main.cpp:
HMODULE samp = GetModuleHandle("samp.dll");
    const char* str = reinterpret_cast<const char*>(samp + 0x11A2F8);
    SF->getSAMP()->getChat()->AddChatMessage(-1, str);

первый кракозябры выводит

второй ошибку выдает о том что addchatmessage его не воспринимает