с основС чего начинать делать софты для SAMPA?
ImGui::Begin(NAME_LOADER, &open, ImVec2(WINDOW_WIDTH, WINDOW_HEIGHT), 1.0f, dwWindowFlag);
{
ImVec2 size_item;
size_item = ImGui::CalcTextSize(u8"Логин");
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - size_item.x) / 2);
ImGui::SetCursorPosY((ImGui::GetWindowHeight() - size_item.y) / 2);
ImGui::Text(u8"Логин");
static char login_text[32];
ImGui::PushItemWidth(ImGui::GetWindowWidth() - 200);
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcItemWidth()) / 2);
ImGui::InputText(u8"", login_text, 32, ImGuiInputTextFlags_CharsHexadecimal);
ImGui::PopItemWidth();
size_item = ImGui::CalcTextSize(u8"Пароль");
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - size_item.x) / 2);
ImGui::Text(u8"Пароль");
static char password_text[32];
ImGui::PushItemWidth(ImGui::GetWindowWidth() - 200);
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcItemWidth()) / 2);
ImGui::InputText(u8"", password_text, 32, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_Password);
ImGui::PopItemWidth();
}
ImGui::End();
Названия измени в инпуте на ##1 и ##2возникла проблема с imgui
создал 2 поля inputtext
![]()
при нажатии на поле логина вводить ничего нельзя, при нажатии на поле пароля я ввожу свой текст, указывая при этом флаг ImGuiInputTextFlags_Password, и этот же текст дублируется в поле логина но уже не зашифрованный
код:
C++:ImGui::Begin(NAME_LOADER, &open, ImVec2(WINDOW_WIDTH, WINDOW_HEIGHT), 1.0f, dwWindowFlag); { ImVec2 size_item; size_item = ImGui::CalcTextSize(u8"Логин"); ImGui::SetCursorPosX((ImGui::GetWindowWidth() - size_item.x) / 2); ImGui::SetCursorPosY((ImGui::GetWindowHeight() - size_item.y) / 2); ImGui::Text(u8"Логин"); static char login_text[32]; ImGui::PushItemWidth(ImGui::GetWindowWidth() - 200); ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcItemWidth()) / 2); ImGui::InputText(u8"", login_text, 32, ImGuiInputTextFlags_CharsHexadecimal); ImGui::PopItemWidth(); size_item = ImGui::CalcTextSize(u8"Пароль"); ImGui::SetCursorPosX((ImGui::GetWindowWidth() - size_item.x) / 2); ImGui::Text(u8"Пароль"); static char password_text[32]; ImGui::PushItemWidth(ImGui::GetWindowWidth() - 200); ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcItemWidth()) / 2); ImGui::InputText(u8"", password_text, 32, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_Password); ImGui::PopItemWidth(); } ImGui::End();
PEDSELF->GetPosition() + CVector(x, y, z)Как это будет на SF/C++ ?Lua:getOffsetFromCharInWorldCoords
Перевести 3д координаты в 2д и отрисовать по этим координатам линиюкак можно сделать линию только не на екране а в 3d?
как можно сделать линию только не на екране а в 3d?
SF->getGame()->convert3DCoordsToScreen(enpos[0], enpos[1], enpos[2], &screen[0], &screen[1]);
А в 3d никак ?Перевести 3д координаты в 2д и отрисовать по этим координатам линию
А в 3d никак ?
А как узнать что обьект на екране?
И есть ли в SF массив со всема обектами, и массив c текстами (label)
CPed* Pedself = GAME->GetPools()->GetPed((DWORD*)SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->pSAMP_Actor->pGTA_Ped);
if (Pedself->IsOnScreen())
{
//Код
}
А это точно код который проверяет что объект на экране?C++:CPed* Pedself = GAME->GetPools()->GetPed((DWORD*)SF->getSAMP()->getPlayers()->pRemotePlayer[i]->pPlayerData->pSAMP_Actor->pGTA_Ped); if (Pedself->IsOnScreen()) { //Код }
bool IsOnScreen(DWORD OBJECT)
{
DWORD dwFunc = FUNC_IsVisible;
DWORD dwThis = (DWORD)SF->getSAMP()->getInfo()->pPools->pObject->object[OBJECT]->pGTAEntity;
bool bReturn = false;
_asm
{
mov ecx, dwThis
call dwFunc
mov bReturn, al
}
return bReturn;
}
Нашел
C++:bool IsOnScreen(DWORD OBJECT) { DWORD dwFunc = FUNC_IsVisible; DWORD dwThis = (DWORD)SF->getSAMP()->getInfo()->pPools->pObject->object[OBJECT]->pGTAEntity; bool bReturn = false; _asm { mov ecx, dwThis call dwFunc mov bReturn, al } return bReturn; }
bool OnScreen(CVector vect)
{
SF->getCLEO()->callOpcode("00C2: %f %f %f 0.0", vect.fX, vect.fY, vect.fZ);
return SF->getCLEO()->GetCondResult();
}