-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Второй день ебусть с тими перчатками. Крашит при FullUpdate. Кинь симпу за помощь.
XVII Помоги, пожалуйста.
Код:
int RandomIntb(int min, int max)
{
return rand() % max + min;
}
bool bGlovesNeedUpdate;
void ApplyCustomGloves(CBaseEntity* pLocal)
{
if (bGlovesNeedUpdate || !pLocal->GetAlive())
{
DWORD* hMyWearables = (DWORD*)((size_t)pLocal + 0x2EF4);
if (!I::ClientEntList->GetClientEntity(hMyWearables[0] & 0xFFF))
{
for (ClientClass* pClass = I::Client->GetAllClasses(); pClass; pClass = pClass->m_pNext)
{
if (pClass->m_ClassID != (int)CSGOClassID::CEconWearable)
continue;
int iEntry = (I::ClientEntList->GetHighestEntityIndex() + 1);
int iSerial = RandomIntb(0x0, 0xFFF);
pClass->m_pCreateFn(iEntry, iSerial);
hMyWearables[0] = iEntry | (iSerial << 16);
break;
}
}
player_info_t LocalPlayerInfo;
I::Engine->GetPlayerInfo(I::Engine->GetLocalPlayer(), &LocalPlayerInfo);
CBaseCombatWeapon* glovestochange = (CBaseCombatWeapon*)I::ClientEntList->GetClientEntity(hMyWearables[0] & 0xFFF);
if (!glovestochange)
return;
switch (Vars.Changer.Glove)
{
case 1:
{
*glovestochange->GetItemDefinitionIndex() = 5027;
glovestochange->SetModelIndex(I::ModelInfo->GetModelIndex("models/weapons/v_models/arms/glove_bloodhound/v_glove_bloodhound.mdl"));
//*glovestochange->ViewModelIndex() = I::ModelInfo->GetModelIndex("models/weapons/v_models/arms/glove_bloodhound/v_glove_bloodhound.mdl");
//*glovestochange->WorldModelIndex() = I::ModelInfo->GetModelIndex("models/weapons/v_models/arms/glove_bloodhound/v_glove_bloodhound.mdl") + 1;
break;
}
case 2:
{
*glovestochange->GetItemDefinitionIndex() = 5032;
glovestochange->SetModelIndex(I::ModelInfo->GetModelIndex("models/weapons/v_models/arms/glove_handwrap_leathery/v_glove_handwrap_leathery.mdl"));
break;
}
case 3:
{
*glovestochange->GetItemDefinitionIndex() = 5031;
glovestochange->SetModelIndex(I::ModelInfo->GetModelIndex("models/weapons/v_models/arms/glove_slick/v_glove_slick.mdl"));
break;
}
case 4:
{
*glovestochange->GetItemDefinitionIndex() = 5030;
glovestochange->SetModelIndex(I::ModelInfo->GetModelIndex("models/weapons/v_models/arms/glove_sporty/v_glove_sporty.mdl"));
break;
}
case 5:
{
*glovestochange->GetItemDefinitionIndex() = 5033;
glovestochange->SetModelIndex(I::ModelInfo->GetModelIndex("models/weapons/v_models/arms/glove_motorcycle/v_glove_motorcycle.mdl"));
break;
}
case 6:
{
*glovestochange->GetItemDefinitionIndex() = 5034;
glovestochange->SetModelIndex(I::ModelInfo->GetModelIndex("models/weapons/v_models/arms/glove_specialist/v_glove_specialist.mdl"));
break;
}
default:
break;
}
switch (Vars.Changer.GloveSkin)
{
case 0:
break;
case 1:
*glovestochange->GetFallbackPaintKit() = 10007;
break;
case 2:
*glovestochange->GetFallbackPaintKit() = 10006;
break;
case 3:
*glovestochange->GetFallbackPaintKit() = 10039;
break;
case 4:
*glovestochange->GetFallbackPaintKit() = 10008;
break;
case 5:
*glovestochange->GetFallbackPaintKit() = 10021;
break;
case 6:
*glovestochange->GetFallbackPaintKit() = 10036;
break;
case 7:
*glovestochange->GetFallbackPaintKit() = 10009;
break;
case 8:
*glovestochange->GetFallbackPaintKit() = 10010;
break;
case 9:
*glovestochange->GetFallbackPaintKit() = 10016;
break;
case 10:
*glovestochange->GetFallbackPaintKit() = 10013;
break;
case 11:
*glovestochange->GetFallbackPaintKit() = 10040;
break;
case 12:
*glovestochange->GetFallbackPaintKit() = 10015;
break;
case 13:
*glovestochange->GetFallbackPaintKit() = 10037;
break;
case 14:
*glovestochange->GetFallbackPaintKit() = 10038;
break;
case 15:
*glovestochange->GetFallbackPaintKit() = 10018;
break;
case 16:
*glovestochange->GetFallbackPaintKit() = 10019;
break;
case 17:
*glovestochange->GetFallbackPaintKit() = 10026;
break;
case 18:
*glovestochange->GetFallbackPaintKit() = 10028;
break;
case 19:
*glovestochange->GetFallbackPaintKit() = 10027;
break;
case 20:
*glovestochange->GetFallbackPaintKit() = 10024;
break;
case 21:
*glovestochange->GetFallbackPaintKit() = 10033;
break;
case 22:
*glovestochange->GetFallbackPaintKit() = 10034;
break;
case 23:
*glovestochange->GetFallbackPaintKit() = 10035;
break;
case 24:
*glovestochange->GetFallbackPaintKit() = 10030;
break;
}
//*glovestochange->GetItemDefinitionIndex() = whatever item definition index you want;
//glovestochange->SetModelIndex(desired model index e.g.GLOVE_BLOOD in your case);
//*glovestochange->GetFallbackPaintKit() = 10008;
*glovestochange->GetItemIDHigh() = -1; //you need to set this to apply the custom stuff you're setting (this is probably your issue)
*glovestochange->GetFallbackWear() = 0.001f;
*glovestochange->GetAccountID() = LocalPlayerInfo.m_nXuidLow;
glovestochange->PreDataUpdate(0);
bGlovesNeedUpdate = false;
}
}
Код:
#include "Cheat.h"
FrameStageNotifyFn oFrameStageNotify;
void __stdcall Hooks::FrameStageNotify(ClientFrameStage_t stage)
{
QAngle aim_punch_old;
QAngle view_punch_old;
QAngle* aim_punch = nullptr;
QAngle* view_punch = nullptr;
if (I::Engine->IsInGame())
{
if (stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START)
{
CBaseEntity *pLocal = I::ClientEntList->GetClientEntity(I::Engine->GetLocalPlayer());
for (int i = 0; i <= I::ClientEntList->GetHighestEntityIndex(); i++) // CHANGE
{
CBaseEntity *pEntity = I::ClientEntList->GetClientEntity(i);
if (pEntity)
{
ApplyCustomGloves(pLocal);
}
}
}
if (stage == FRAME_RENDER_START)
{
if (G::LocalPlayer && G::LocalPlayer->GetAlive()
&& Vars.Visuals.Removals.VisualRecoil)
{
aim_punch =
(QAngle*)((DWORD)G::LocalPlayer + offsets.m_aimPunchAngle);
view_punch =
(QAngle*)((DWORD)G::LocalPlayer + offsets.m_viewPunchAngle);
aim_punch_old = *aim_punch;
view_punch_old = *view_punch;
*aim_punch = QAngle(0, 0, 0);
*view_punch = QAngle(0, 0, 0);
}
for (int i = 1; i <= I::Globals->maxClients; i++)
{
if (i == I::Engine->GetLocalPlayer())
continue;
CBaseEntity* pCurEntity = I::ClientEntList->GetClientEntity(i);
if (!pCurEntity)
continue;
*(int*)((uintptr_t)pCurEntity + 0xA30) = I::Globals->framecount;
*(int*)((uintptr_t)pCurEntity + 0xA28) = 0;
}
}
if (aim_punch && view_punch && Vars.Visuals.Removals.VisualRecoil)
{
*aim_punch = aim_punch_old;
*view_punch = view_punch_old;
}
}
oFrameStageNotify(stage);
}
Код:
void CBaseCombatWeapon::SetModelIndex(int modelIndex)
{
typedef void(__thiscall* OriginalFn)(void*, int);
return U::GetVFunc<OriginalFn>(this, 75)(this, modelIndex);
}
void CBaseCombatWeapon::PreDataUpdate(int updateType)
{
PVOID pNetworkable = (PVOID)((DWORD)(this) + 0x8);
typedef void(__thiscall* OriginalFn)(PVOID, int);
return U::GetVFunc<OriginalFn>(pNetworkable, 6)(pNetworkable, updateType);
}
Код:
void CHacks::Apply()
{
static ConVar* Meme = I::Cvar->FindVar("cl_fullupdate");
Meme->nFlags &= ~FCVAR_CHEAT;
I::Engine->ClientCmd_Unrestricted("cl_fullupdate", NULL);
bGlovesNeedUpdate = true;
}
XVII Помоги, пожалуйста.