What exactly you need?How can I get the color in hexadecimal format of this ImGui::ColorPicker ?
Посмотреть вложение 153216
If I can get both values that would be great, if not enough with string hex colorWhat exactly you need?
ImVec4 -> int color?
ImVec4 -> string hex color?
If I can get both values that would be great, if not enough with string hex color
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);
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);
C-Style string view:
string-view:C++:const char* str = reinterpret_cast<const char*>(address);
string copy:C++:std::string_view str{reinterpret_cast<const char*>(address)/*, [optional] size*/};
C++:std::string str{reinterpret_cast<const char*>(address)/*, [optional] size*/};
HMODULE samp = GetModuleHandle("samp.dll");
const char* str = reinterpret_cast<const char*>(samp + 0x11A2F8);
SF->getSAMP()->getChat()->AddChatMessage(-1, str);
Он просто приводит адрес к сишной строке. Если там лежат кракозябры - ясен хуй кракозябры будут.первый кракозябры выводит
наверное потому что нужно сначала C++ изучить.второй ошибку выдает о том что addchatmessage его не воспринимает
В том то и дело что неттам лежат кракозябры
print(memory.tostring(getModuleHandle("samp.dll") + 0x11A2F8))
В том-то и дело, что да. Иди учи основы языка, потом возвращайся.В том то и дело что нет
Как вывести переменную записаную определенное кол-во времени назад
char buffer[64];
sprintf_s(buffer, "RPC id: %d", id); // id - переменная
g_Chat->AddMessage(-1, buffer);
struct c_chat* g_chat{ nullptr };
uintptr_t base_address{ 0 };
unsigned long get_address(uintptr_t offset)
{
return base_address + offset;
}
void initialize()
{
base_address = reinterpret_cast<uintptr_t>(GetModuleHandleA("samp.dll"));
g_chat = *reinterpret_cast<struct c_chat**>(get_address(0x26E8C8));
}
void add_chat_message(u_long color, const char* szText)
{
((void(__thiscall*)(c_chat*, unsigned long, const char*))get_address(0x679F0))(g_chat, color, szText);
}
void main()
{
int id_banan = 2;
initialize();
char buffer[64];
sprintf_s(buffer, "Banan id: %d", id_banan);
add_chat_message(-1, buffer);
}