Quote:
Originally Posted by joropito
Please expand your idea. Maybe you can get help on that.
Also please upload images and videos.
|
Well, the idea is removing the Execute Ham Primary Attack call from attack forward to apply custom attack.
You want the way? Here, this is i'm currently using and will include it in next update:
Code:
#include <xs>
#include <orpheu>
#include <orpheu_stocks>
new OrpheuFunction:handleApplyMultiDamage;
new OrpheuFunction:handleClearMultiDamage;
public plugin_init()
{handleApplyMultiDamage = OrpheuGetFunction("ApplyMultiDamage");
handleClearMultiDamage = OrpheuGetFunction("ClearMultiDamage");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_glock18", "HamF_Weapon_PrimaryAttack");
}
public HamF_Weapon_PrimaryAttack(iEnt)
{
static id;
id = get_pdata_cbase(iEnt, m_pPlayer, 4);
//Starting now calculate our custom attack
new Float: vecSrc[3], Float: vecForward[3], Float:vecViewOfs[3];
pev(id, pev_origin, vecSrc);
pev(id, pev_view_ofs, vecViewOfs);
xs_vec_add(vecSrc, vecViewOfs, vecSrc);
FireBullets(vecSrc, vecForward, 8192.0, 3, 30.0/*<<<damage*/, id);
return HAM_SUPERCEDE;
}
stock FireBullets(Float:vecSrc[3], Float:vecDir[3], Float:flDistance, iPenetration, Float:flDamage, pevAttacker)
{
new Float:vecEnd[3], Float:vecEndPos[3], Float:vecForward[3];
new tr = create_tr2();
new Float:flFraction, Float:flCurrentDistance;
xs_vec_mul_scalar(vecDir, flDistance, vecForward);
xs_vec_add(vecSrc, vecForward, vecEnd);
while (iPenetration != 0)
{
OrpheuCall(handleClearMultiDamage);
engfunc(EngFunc_TraceLine, vecSrc, vecEnd, DONT_IGNORE_MONSTERS, pevAttacker, tr);
get_tr2(tr, TR_flFraction, flFraction);
if (flFraction != 1.0)
{new pEntity = get_tr2(tr, TR_pHit);
if (pEntity < 0)
{
return;
}
iPenetration--;
flCurrentDistance = flFraction * flDistance;
get_tr2(tr, TR_vecEndPos, vecEndPos);
xs_vec_mul_scalar(vecDir, 42.0, vecForward);
xs_vec_add(vecEndPos, vecForward, vecSrc);
flDistance = (flDistance - flCurrentDistance) * 0.75;
xs_vec_mul_scalar(vecDir, flDistance, vecForward);
xs_vec_add(vecSrc, vecForward, vecEnd);
ExecuteHamB(Ham_TraceAttack, pEntity, pevAttacker, flDamage, vecDir, tr, DMG_BULLET | DMG_NEVERGIB);
}
else
{
iPenetration = 0;
}
OrpheuCall(handleApplyMultiDamage, pevAttacker, pevAttacker);
}
}
Also not only this. Ok, later gonna go now.