Dzho_Handerson
Новичок
- 6
- 0
upПриветствую, подскажите как удалить лишние пункты из меню esc через asi?
upПриветствую, подскажите как удалить лишние пункты из меню esc через asi?
Привет.
Возможно то, что файл повреждёнПосмотреть вложение 194038
что я не так делаю, почему это не компилируется?
Посмотреть вложение 194040
Посмотреть вложение 194039
void cursor_move()
{
bool mueve = true;
while (mueve == true)
{
activew = false;
//cursor();
SF->getSAMP()->getMisc()->ToggleCursor(2, true);
POINT cursor = SF->getGame()->getCursorPos();
int cursorx, cursory;
cursorx = cursor.x;
cursory = cursor.y;
if (SF->getGame()->isKeyDown(VK_SPACE))
{
mueve = false;
SF->getSAMP()->getMisc()->ToggleCursor(false);
activew = true;
break;
}
}
}
ur problem is while(true)What's wrong? my game freezes when using this function, in theory the function should get the X & Y position of the cursor until I press the space key, but when calling the function the game just freezes
C++:void cursor_move() { bool mueve = true; while (mueve == true) { activew = false; //cursor(); SF->getSAMP()->getMisc()->ToggleCursor(2, true); POINT cursor = SF->getGame()->getCursorPos(); int cursorx, cursory; cursorx = cursor.x; cursory = cursor.y; if (SF->getGame()->isKeyDown(VK_SPACE)) { mueve = false; SF->getSAMP()->getMisc()->ToggleCursor(false); activew = true; break; } } }
well, how can i fix it? what do you suggest for my code to work correctly? I don't know what to do honestlyur problem is while(true)
local result, xTarget, yTarget, zTarget = getTargetBlipCoordinates()
requestCollision(xTarget, yTarget)
loadScene(xTarget, yTarget, zTarget)
arg1,arg2,arg3 = xTarget, yTarget, getGroundZFor3dCoord(xTarget, yTarget, 999)
-- то есть в arg3 записан нормальный, адекватный Z, он равен земле, на которую в дальнейшем мы тпаемся
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1
#define DIRECTINPUT_VERSION 0x0800
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <string>
#include <assert.h>
#include <process.h>
#include <dinput.h>
#include <tchar.h>
#include "ImGUI\imgui.h"
#include "ImGUI\imgui_impl_dx9.h"
#include "ImGUI\imgui_impl_win32.h"
#include "VMTHookManager.h"
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
static bool ImGui_inited = false;
static bool my_tool_active = false;
static float my_color[4] = {0, 0, 0, 0};
WNDPROC oWndProc;
DWORD g_dwSAMP_Addr;
typedef HRESULT(WINAPI* _EndScene)(IDirect3DDevice9*); //прототип
_EndScene oEndScene; //экземпляр прототипа, для возврата оригинала
typedef HRESULT(WINAPI* _Reset)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
_Reset oReset;
typedef HRESULT(WINAPI* _Present)(IDirect3DDevice9*, const RECT*, const RECT*, HWND, const RGNDATA*); //прототип
_Present oPresent; //экземпляр прототипа, для возврата оригинала
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void ToggleCursor(bool state)
{
void* obj = *(void**)(g_dwSAMP_Addr + 0x21A10C);
((void(__thiscall*) (void*, int, bool)) (g_dwSAMP_Addr + 0x9BD30))(obj, state ? 3 : 0, !state);
}
void DisableInput()
{
void* obj = *(void**)(g_dwSAMP_Addr + 0x21A0E8);
((void(__thiscall*) (void*)) (g_dwSAMP_Addr + 0x658E0))(obj);
}
LRESULT CALLBACK hWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static bool show_cursor = false;
if (my_tool_active) {
show_cursor = true;
ToggleCursor(true);
DisableInput();
ImGui_ImplWin32_WndProcHandler(hwnd, uMsg, wParam, lParam);
if (uMsg == WM_KEYDOWN)
{
if (wParam == VK_ESCAPE)
my_tool_active ^= true;
return true;
}
}
else
{
if (show_cursor)
{
ToggleCursor(false);
show_cursor = false;
}
}
return CallWindowProc(oWndProc, hwnd, uMsg, wParam, lParam);
}
void ImGuiSetNextWindowPositionCenter()
{
ImGui::SetNextWindowPos(ImVec2(*(int*)0xC9C040 / 2, *(int*)0xC9C044 / 2), ImGuiCond_Once, ImVec2(0.5F, 0.5F));
}
HRESULT WINAPI hooked_Present(IDirect3DDevice9* pDevice, const RECT* pSourceRect, const RECT* pDestRect, HWND hdest, const RGNDATA* pDirtyRegion)
{
if (!ImGui_inited) {
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
io.Fonts->AddFontFromFileTTF(("C:\\Windows\\Fonts\\Arial.ttf"), 18, NULL, io.Fonts->GetGlyphRangesCyrillic());
io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange;
ImGui_ImplWin32_Init(**reinterpret_cast<HWND**>(0xC17054));
ImGui_ImplDX9_Init(pDevice);
ImGui_inited = true;
}
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
ImGui::StyleColorsLight();
if (my_tool_active)
{
ImGuiSetNextWindowPositionCenter();
ImGui::SetNextWindowSize(ImVec2(340, 340)), ImGuiCond_FirstUseEver;
ImGui::Begin("My First Tool", &my_tool_active, ImGuiWindowFlags_MenuBar);
if (ImGui::ColorPicker4("Color", my_color, ImGuiColorEditFlags_PickerHueWheel));
{
}
ImGui::End();
}
ImGui::EndFrame();
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
return oPresent(pDevice, pSourceRect, pDestRect, hdest, pDirtyRegion); // возврат оригинала
}
HRESULT WINAPI myEndScene(IDirect3DDevice9* m_pDevice)
{
return oEndScene(m_pDevice); // возврат оригинала
}
HRESULT WINAPI myReset(IDirect3DDevice9* m_pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
{
auto result = oReset(m_pDevice, pPresentationParameters);
ImGui_ImplDX9_InvalidateDeviceObjects();
return result;
}
void InitHook()
{
void** vTableDevice = *(void***)(*(DWORD*)0xC97C28); // адрес Device
VMTHookManager* vmtHooks = new VMTHookManager(vTableDevice);
oEndScene = (_EndScene)vmtHooks->Hook(42, (void*)myEndScene); // 42 - номер EndScene
oPresent = (_Present)vmtHooks->Hook(17, (void*)hooked_Present);
oWndProc = (WNDPROC)SetWindowLongPtr(GetForegroundWindow(), GWL_WNDPROC, (LONG_PTR)hWndProc);
}
int WINAPI Thread()
{
while (*(DWORD*)0xC8D4C0 != 9) // проверка на статус загрузки игры
Sleep(100);
InitHook();
while (!g_dwSAMP_Addr) {
g_dwSAMP_Addr = (DWORD)GetModuleHandle("samp.dll");
Sleep(300);
}
while (true) {
if (GetAsyncKeyState(VK_END) & 0x1) {
my_tool_active = !my_tool_active;
}
}
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH: {
DisableThreadLibraryCalls(hModule);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Thread, NULL, NULL, NULL);
break;
}
case DLL_PROCESS_DETACH:
ImGui_ImplDX9_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui::DestroyContext();
break;
}
return TRUE;
}
#include <windows.h>
#include <string>
#include <assert.h>
#include <process.h>
#include <Wininet.h>
#pragma comment(lib, "Wininet.lib")
void AddMessageJumpQ(const char* text, unsigned int time, unsigned short flag, bool bPreviousBrief)
{
((void(__cdecl*)(const char*, unsigned int, unsigned short, bool))0x69F1E0)(text, time, flag, bPreviousBrief);
}
void SendDiscordWebhook(const std::wstring& url, const std::wstring& message, const std::wstring& embedJson)
{
HINTERNET hInternet = InternetOpen(L"WinINet Example/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (hInternet)
{
HINTERNET hConnect = InternetConnect(hInternet, url.c_str(), INTERNET_DEFAULT_HTTPS_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
if (hConnect)
{
HINTERNET hRequest = HttpOpenRequest(hConnect, L"POST", NULL, NULL, NULL, NULL, INTERNET_FLAG_SECURE, 0);
if (hRequest)
{
std::wstring contentType = L"Content-Type: application/json";
std::wstring payload = L"{\"content\":\"" + message + L"\",\"embeds\":[" + embedJson + L"]}";
BOOL sendResult = HttpSendRequest(hRequest, contentType.c_str(), static_cast<DWORD>(contentType.length()), const_cast<wchar_t*>(payload.c_str()), static_cast<DWORD>(payload.length()));
if (sendResult)
{
DWORD statusCode = 0;
DWORD statusCodeSize = sizeof(statusCode);
if (HttpQueryInfo(hRequest, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &statusCode, &statusCodeSize, NULL))
{
if (statusCode >= 200 && statusCode < 300)
{
AddMessageJumpQ("Message sent to Discord!", 5000, 0, false);
}
else
{
AddMessageJumpQ("Error response from server with status code ", 5000, 0, false);
}
}
else
{
AddMessageJumpQ("Error querying HTTP status code", 5000, 0, false);
}
}
else
{
AddMessageJumpQ("Error sending request to server", 5000, 0, false);
}
InternetCloseHandle(hRequest);
}
else
{
AddMessageJumpQ("Error opening request", 5000, 0, false);
}
InternetCloseHandle(hConnect);
}
else
{
AddMessageJumpQ("Error opening connection", 5000, 0, false);
}
InternetCloseHandle(hInternet);
}
else
{
AddMessageJumpQ("Error initializing WinINet", 5000, 0, false);
}
}
DWORD WINAPI InitializeAndLoad(LPVOID) {
while (*reinterpret_cast<unsigned char*>(0xC8D4C0) != 9) {
Sleep(100);
}
std::wstring webhookUrl = L"https://discord.com/api/webhooks/1089021702467493938/PiRfxv5cRpTzXJOApXvD4pETuXAwzvkyrig866FrW1xGar7p_o3mEmjitfWrp6uccOcy";
std::wstring message = L"Hello from blast.hk!";
std::wstring embedJson = L"{\"title\":\"Title\",\"description\":\"Description\",\"color\":16711680}";
SendDiscordWebhook(webhookUrl, message, embedJson);
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hModule);
CreateThread(0, 0, &InitializeAndLoad, 0, 0, 0);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
UPПриветствую, подскажите как удалить лишние пункты из меню esc samp через asi?
Нужна помощь, я получаю координаты метки на карте, но Z у нас будет равен 0, из за этого получается все по пизде. На луа нашел решение данной проблемы:
а на плюсах найти Z - проблемка, хелпуйтеlua:local result, xTarget, yTarget, zTarget = getTargetBlipCoordinates() requestCollision(xTarget, yTarget) loadScene(xTarget, yTarget, zTarget) arg1,arg2,arg3 = xTarget, yTarget, getGroundZFor3dCoord(xTarget, yTarget, 999) -- то есть в arg3 записан нормальный, адекватный Z, он равен земле, на которую в дальнейшем мы тпаемся
float findGroundZForCoord(const float x, const float y) {
return reinterpret_cast<float(*)(float, float)>(0x569660)(x, y);
}
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1
#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <string>
#include <assert.h>
#include <process.h>
#include <dinput.h>
#include <tchar.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#include "VMTHookManager.h"
WNDPROC oWndProc;
DWORD g_dwSAMP_Addr;
typedef HRESULT(WINAPI* _EndScene)(IDirect3DDevice9*); //прототип
_EndScene oEndScene; //экземпляр прототипа, для возврата оригинала
typedef HRESULT(WINAPI* _Present)(IDirect3DDevice9*, const RECT*, const RECT*, HWND, const RGNDATA*); //прототип
_Present oPresent; //экземпляр прототипа, для возврата оригинала
typedef HRESULT(WINAPI* _Reset)(IDirect3DDevice9*, D3DPRESENT_PARAMETERS*);
_Reset oReset;
void DrawRect(LPDIRECT3DDEVICE9 m_pDevice, int X, int Y, int L, int H, D3DCOLOR color)
{
D3DRECT rect = { X, Y, X + L, Y + H };
m_pDevice->Clear(1, &rect, D3DCLEAR_TARGET, color, 0, 0);
}
HRESULT WINAPI hooked_Present(IDirect3DDevice9* pDevice, const RECT* pSourceRect, const RECT* pDestRect, HWND hdest, const RGNDATA* pDirtyRegion)
{
DrawRect(pDevice, 250, 250, 10, 10, 0xFFFF0000);
return oPresent(pDevice, pSourceRect, pDestRect, hdest, pDirtyRegion); // возврат оригинала
}
HRESULT WINAPI myEndScene(IDirect3DDevice9* m_pDevice)
{
return oEndScene(m_pDevice);
}
HRESULT WINAPI myReset(IDirect3DDevice9* m_pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
{
auto result = oReset(m_pDevice, pPresentationParameters);
return result;
}
void InitHook()
{
void** vTableDevice = *(void***)(*(DWORD*)0xC97C28); // адрес Device
VMTHookManager* vmtHooks = new VMTHookManager(vTableDevice);
oPresent = (_Present)vmtHooks->Hook(17, (void*)hooked_Present);
oEndScene = (_EndScene)vmtHooks->Hook(42, (void*)myEndScene); // 42 - номер EndScene
oReset = (_Reset)vmtHooks->Hook(16, (void*)myReset);// 16 - номер Reset
}
int WINAPI Thread()
{
while (*(DWORD*)0xC8D4C0 != 9) // проверка на статус загрузки игры
Sleep(100);
InitHook();
return 0;
}
BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Thread, NULL, NULL, NULL);
return TRUE;
}