-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
#define j_malloc ((void* (*)(unsigned int))0x146B050)
#define j_free ((void*(*)(void*))0xAEC180)
#define j_memcpy ((void*(*)(void*, void const*, unsigned int))0x16E616C)
#define j_memmove ((void*(*)(void*, void const*, unsigned int))0x16E6080)
#define j_memset ((void*(*)(void*, int, unsigned int))0x16E6172)
#define j_strstr ((int(*)(const char*, const char*))0x16E6098)
#define j_strcmp ((int(*)(const char*, const char*))0x16E6822)
Код:
void * operator new[](unsigned int s)
{
return j_malloc(s);
}
void * operator new(unsigned int s)
{
return j_malloc(s);
}
void operator delete(void * p, unsigned int s)
{
j_free(p);
}
void operator delete(void* p)
{
j_free(p);
}
void operator delete[](void* p)
{
j_free(p);
}
Код:
const char Shield[7] = { 'S', 'h', 'i', 'e', 'l', 'd', '\0' };
const char IronMan[8] = { 'I', 'r', 'o', 'n', 'M', 'a', 'n', '\0' };
const char Drone[6] = { 'D', 'r', 'o', 'n', 'e', '\0' };
const char HeavyTurret[12] = { 'H', 'e', 'a', 'v', 'y', 'T', 'u', 'r', 'r', 'e', 't', '\0' };
const char Mantis[7] = { 'M', 'a', 'n', 't', 'i', 's', '\0' };
const char Helicopter[11] = { 'H', 'e', 'l', 'i', 'c', 'o', 'p', 't', 'e', 'r', '\0' };
const char TurretAPC[10] = { 'T', 'u', 'r', 'r', 'e', 't', 'A', 'P', 'C', '\0' };
const char mech2300[9] = { 'm', 'e', 'c', 'h', '2', '3', '0', '0', '\0' };
const char SED[4] = { 'S', 'E', 'D', '\0' };
const char Cyborg[7] = { 'C', 'y', 'b', 'o', 'r', 'g', '\0' };
const char Destroyer[10] = { 'D', 'e', 's', 't', 'r', 'o', 'y', 'e', 'r', '\0' };
const char Turret[7] = { 'T', 'u', 'r', 'r', 'e', 't', '\0' };
Код:
if (j_strstr(Name, HeavyTurret)) vBoneId = 52;
Код:
class CInputManager
{
public:
CInputManager()
{
j_memset(this, 0, sizeof(*this));
}
void Update()
{
for (int i = 0; i < eKI_MaxIndex; ++i)
{
if (GetKeyState(i))
{
if (State[i] == 1 && Pressed[i] == 0 && Press[i]) Press[i] = 0;
if (State[i] == 0 && Pressed[i] == 0) State[i] = Pressed[i] = 1;
}
else State[i] = Pressed[i] = Press[i] = 0;
}
}
bool GetKeyState(int KeyId)
{
DWORD Symbol = *(DWORD*)(gInputSymbols + 4 * KeyId);
return Symbol ? *(DWORD*)(Symbol + 0xC) == 4 : false;
}
bool GetAsyncKeyState(EKeyId KeyId)
{
if (State[KeyId] && (Pressed[KeyId] || Press[KeyId]))
{
++Press[KeyId];
Pressed[KeyId] = 0;
return true;
}
return false;
}
private:
bool State[eKI_MaxIndex], Pressed[eKI_MaxIndex];
uint16 Press[eKI_MaxIndex];
};
Код:
bool IsInBox(float x, float y, float w, float h)
{
float MouseX, MouseY;
gEnv->pHardwareMouse->GetHardwareMouseClientPosition(&MouseX, &MouseY);
return (MouseX >= x && MouseX <= x + w && MouseY >= y && MouseY <= y + h);
}
int __stdcall Frame()
{
InputManager->Update();
m_pUIDraw->PreRender();
if (IsInBox(100, 100, 50, 50))
{
if (InputManager->GetAsyncKeyState(eKI_mouse1))
{
}
}
//Draw
m_pUIDraw->PostRender();
return 0;
}