-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Use!
QAngle GetTFSpread(C_BaseCombatWeapon *pBaseWeapon, QAngle viewangles, int random_seed)
{
if(pGlobals->curtime - *reinterpret_cast<GenDT_TFWeaponBase*>(pBaseWeapon)->LocalActiveTFWeaponData()->flLastFireTime() > 2.0f)
return *new QAngle(0, 0, 0);
vRandomSeed(random_seed & 255);
float Spread = 0.0f;
__asm
{
MOV ESI, pBaseWeapon;
MOV EDX, DWORD PTR DS:[ESI];
MOV EAX, DWORD PTR DS:[EDX+0x678];
MOV ECX, ESI;
CALL EAX;
FSTP Spread
}
float x = vRandomFloat(-0.5, 0.5) + vRandomFloat(-0.5, 0.5);
float y = vRandomFloat(-0.5, 0.5) + vRandomFloat(-0.5, 0.5);
QAngle spreadAngles;
Vector forward, right, up;
AngleVectors(viewangles, &forward, &right, &up);
Vector vecDir = forward + (x * Spread * right) + (y * Spread * up);
VectorAngles(vecDir, spreadAngles);
spreadAngles -= viewangles;
return spreadAngles;
}
QAngle GetTFSpread(C_BaseCombatWeapon *pBaseWeapon, QAngle viewangles, int random_seed)
{
if(pGlobals->curtime - *reinterpret_cast<GenDT_TFWeaponBase*>(pBaseWeapon)->LocalActiveTFWeaponData()->flLastFireTime() > 2.0f)
return *new QAngle(0, 0, 0);
vRandomSeed(random_seed & 255);
float Spread = 0.0f;
__asm
{
MOV ESI, pBaseWeapon;
MOV EDX, DWORD PTR DS:[ESI];
MOV EAX, DWORD PTR DS:[EDX+0x678];
MOV ECX, ESI;
CALL EAX;
FSTP Spread
}
float x = vRandomFloat(-0.5, 0.5) + vRandomFloat(-0.5, 0.5);
float y = vRandomFloat(-0.5, 0.5) + vRandomFloat(-0.5, 0.5);
QAngle spreadAngles;
Vector forward, right, up;
AngleVectors(viewangles, &forward, &right, &up);
Vector vecDir = forward + (x * Spread * right) + (y * Spread * up);
VectorAngles(vecDir, spreadAngles);
spreadAngles -= viewangles;
return spreadAngles;
}