можешь перебрать всех педов и проверять соотвествие =Dхз, мб как-то и связан, CPed же можно по иду получить
C++:CPed *ped = CPools::GetPed(pSAMP->getPlayers()->pRemotePlayer[playerID]->pPlayerData->pSAMP_Actor->ulGTAEntityHandle);
можешь перебрать всех педов и проверять соотвествие =Dхз, мб как-то и связан, CPed же можно по иду получить
C++:CPed *ped = CPools::GetPed(pSAMP->getPlayers()->pRemotePlayer[playerID]->pPlayerData->pSAMP_Actor->ulGTAEntityHandle);
unsigned __int16 stPlayerPool::GetPlayerIDFromCPed(CPed *pPed) {
if (pPed == FindPlayerPed())
return pSAMP->getPlayers()->sLocalPlayerID;
for (unsigned __int16 i = 0; i != SAMP_MAX_PLAYERS; i++) {
if (!pSAMP->getPlayers()->IsPlayerStreamed(i))
continue;
if (pPed == (CPed*)pSAMP->getPlayers()->pRemotePlayer[i]->pPlayerData->pSAMP_Actor->pGTA_Ped)
return i;
}
return 0xFFFF;
}
Вопрос: Можно ли задать координаты ImGui::Image, если да то как.
Возможный ответ: Использовать setcursorpos?
ImGui::SetCursorPos({ X, Y }); // Замени на свою позицию
ImGui::Image(...);
SAMP-API/CPlayerPool.h at multiver · BlastHackNet/SAMP-API · GitHubкак получить ид самп игрока через указатель на CPed? использую plugin sdk
enum DetectedCoding { ASCII, UTF8, OTHER };
DetectedCoding DetectEncoding(const std::string& s)
{
const char* cs = s.c_str();
DetectedCoding d = ASCII;
while (*cs)
{
unsigned char b = (unsigned char)*(cs++);
if (b & 0x80) { // not a plain ASCII character
// if the string is already UTF8 encoded, then it must conform to a multibyte sequence standard. Let's verify it
if (b < 0xC0) // first of all, b must start with 11
return OTHER; // no multibyte sequence starts with 10xxxxxx
// now we expect a number of continuation bytes, depending on the number of ones following the 11
size_t nCont = 0;
if (b < 0xE0) // two bytes sequence: 110xxxxx 10xxxxxx
nCont = 1;
else if (b < 0xF0) // three bytes sequence: 1110xxxx 10xxxxxx 10xxxxxx
nCont = 2;
else if (b < 0xF8) // four bytes sequence: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
nCont = 3;
else if (b < 0xFC) // five bytes sequence: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
nCont = 4;
else if (b < 0xFE) // six bytes sequence: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
nCont = 5;
else
return OTHER; // no multibyte sequence starts with 1111111x
while (nCont--)
if (((unsigned char)*(cs++) & 0xC0) != 0xC0) // in case string ends, 0 is found so the following test prevents us from illegal memory access
return OTHER; // each continuation byte must starts with 10xxxxxx
d = UTF8;
}
}
return d;
}
int* ptr = (int*)((char*)GetModuleHandleA(0) + 0x9C4EE0);
int lastnumber = 0;
int* elid2 = 0;
char* buff2 = 0;
bool checkptr()
{
if (*ptr == 0)
return 0;
elid2 = (int*)(*ptr + 8);
if (*elid2)
{
buff2 = (char*)(*ptr + 0xD4);
if (*(int*)elid2 >= IDSTAT_START)
if (*(int*)elid2 <= IDSTAT_END)
return 1;
}
return 0;
Покажи строку в hex виде в hex view у cheatengineУ меня уже мозг расплавился от этой чихарды.
Имеется старая игра warzone2100, где по указателю хранится строка
Посмотреть вложение 91499
Это однобайтовая кодировка, но лишь cheat engine выводит её нормально
Читая её как char*, я получаю козяблики
Выводя её через opengl рендер, вижу тоже самое, что и через MessageBoxA
CharToOem и наоборот -- никак не помогают прочитать эту чёртову строку.
Нагуглил функцию "определения кодировки", и по её показаниям, это не ascii и не ut8
Это совершенно точно НЕ мой косяк при чтении, потому что все указатели проверяются, и чтение происходит, лишь когда курсор наведён на иконку элемента, обладающего строкой по нужному оффсету:[/code]C++:enum DetectedCoding { ASCII, UTF8, OTHER }; DetectedCoding DetectEncoding(const std::string& s) { const char* cs = s.c_str(); DetectedCoding d = ASCII; while (*cs) { unsigned char b = (unsigned char)*(cs++); if (b & 0x80) { // not a plain ASCII character // if the string is already UTF8 encoded, then it must conform to a multibyte sequence standard. Let's verify it if (b < 0xC0) // first of all, b must start with 11 return OTHER; // no multibyte sequence starts with 10xxxxxx // now we expect a number of continuation bytes, depending on the number of ones following the 11 size_t nCont = 0; if (b < 0xE0) // two bytes sequence: 110xxxxx 10xxxxxx nCont = 1; else if (b < 0xF0) // three bytes sequence: 1110xxxx 10xxxxxx 10xxxxxx nCont = 2; else if (b < 0xF8) // four bytes sequence: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx nCont = 3; else if (b < 0xFC) // five bytes sequence: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx nCont = 4; else if (b < 0xFE) // six bytes sequence: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx nCont = 5; else return OTHER; // no multibyte sequence starts with 1111111x while (nCont--) if (((unsigned char)*(cs++) & 0xC0) != 0xC0) // in case string ends, 0 is found so the following test prevents us from illegal memory access return OTHER; // each continuation byte must starts with 10xxxxxx d = UTF8; } } return d; }
C++:int* ptr = (int*)((char*)GetModuleHandleA(0) + 0x9C4EE0); int lastnumber = 0; int* elid2 = 0; char* buff2 = 0; bool checkptr() { if (*ptr == 0) return 0; elid2 = (int*)(*ptr + 8); if (*elid2) { buff2 = (char*)(*ptr + 0xD4); if (*(int*)elid2 >= IDSTAT_START) if (*(int*)elid2 <= IDSTAT_END) return 1; } return 0;
Отчаянно прошу помощи! Нихрена нагуглить не смог, все мне известные способы конвертации -- тоже не работают! Ужасно!
Вот, например:Покажи строку в hex виде в hex view у cheatengine
46 75 65 6C 20 49 6E 6A 65 63 74 69 6F 6E 20 45 6E 67 69 6E 65 20 4D 6B 33 0A 43 6F 73 74 3A 20 31 35 30 00 6F 00 75 00 6E 00
Fuel Injection Engine Mk3
Cost: 150
ты явно в коде делаешь что-то не так:Вот, например:
Код:46 75 65 6C 20 49 6E 6A 65 63 74 69 6F 6E 20 45 6E 67 69 6E 65 20 4D 6B 33 0A 43 6F 73 74 3A 20 31 35 30 00 6F 00 75 00 6E 00
Код:Fuel Injection Engine Mk3 Cost: 150
ты явно в коде делаешь что-то не так:
Посмотреть вложение 91536
BOOL __stdcall PHook::hkSwapBuffers(_In_ HDC hdc)
{
if (!init)
{
//MessageBox(NULL, "1", "2", MB_OK);
init = true;
}
HWND hwnd = GetForegroundWindow();
if (hwnd && checkptr())
{
POINT cur;
GetCursorPos(&cur);
ScreenToClient(hwnd, &cur);
PHook::SetupOrtho();
glShadeModel(GL_SMOOTH);
/*glBegin(GL_QUADS);
glColor4f(1.0F, 0.0F, 0.5F, 0.5F);
glVertex2f(cur.x + 50, cur.y + 30);
glVertex2f(cur.x + 250.0, cur.y + 30);
glVertex2f(cur.x + 250.0, cur.y + 250.0);
glVertex2f(cur.x + 50, cur.y + 250.0);
glEnd();*/
glColor4f(0.5F, 7.0F, 0.1F, 1.0F);
wglUseFontBitmaps(hdc, 0, 256, 1000);
glRasterPos2f(cur.x + 30.0, cur.y + 65.0);
glListBase(1000);
/*int screen[2];
glGetIntegerv(GL_VIEWPORT, screen);*/
char totxt[256];
char totxt2[256];
memset(totxt, 0, 256);
OemToCharA(buff2, totxt);
CharToOemA(buff2, totxt2);
glCallLists(10, GL_UNSIGNED_BYTE, totxt);
glRasterPos2f(cur.x + 30.0, cur.y + 80.0);
glCallLists(20, GL_UNSIGNED_BYTE, buff2);
glRasterPos2f(cur.x + 30.0, cur.y + 95.0);
glCallLists(20, GL_UNSIGNED_BYTE, totxt2);
glFlush();
glDeleteLists(1000, 256);
PHook::Restore();
}
return oSwapBuffers(hdc);
}
Надо не удалять, а не вызывать создания искры от пули. Ищешь адресс в плагин СДК(без знаний примитивного английского и логики поиска хер найдешь) и когда нужно на него ставишь ноп. Это я лишь логику работы описал. Не сам рабочий код.Как можно удалить искру от пули. Именно искру попадания в стену, а не трассер
А может просто возьмешь сурс моего аима и отправишь пулю куда тебе надо?Как можно удалить искру от пули. Именно искру попадания в стену, а не трассер