mirror of
https://github.com/rehlds/reapi.git
synced 2024-12-29 08:05:36 +03:00
Added new native: rg_fire_buckshots
(#204)
* Added new native: `rg_fire_buckshots` * Fix typo * Update CSEntity.h Co-authored-by: Sergey Shorokhov <wopox1337@ya.ru>
This commit is contained in:
parent
e966296b5f
commit
1aaddea738
@ -342,6 +342,23 @@ native rg_multidmg_add(const inflictor, const victim, const Float:flDamage, cons
|
||||
*/
|
||||
native rg_fire_bullets(const inflictor, const attacker, const shots, Float:vecSrc[3], Float:vecDirShooting[3], Float:vecSpread[3], const Float:flDistance, const Bullet:iBulletType, const iTracerFreq, const iDamage);
|
||||
|
||||
/*
|
||||
* Fires buckshots from entity.
|
||||
*
|
||||
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
|
||||
* @param attacker Attacker is the entity that triggered the damage (such as the gun's owner)
|
||||
* @param shots The number of shots
|
||||
* @param vecSrc The source position of the barrel
|
||||
* @param vecDirShooting Shooting direction
|
||||
* @param vecSpread Spread
|
||||
* @param flDistance Max shot distance
|
||||
* @param iTracerFreq Tracer frequency
|
||||
* @param iDamage Damage amount
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
native rg_fire_buckshots(const inflictor, const attacker, const shots, Float:vecSrc[3], Float:vecDirShooting[3], Float:vecSpread[3], const Float:flDistance, const iTracerFreq, const iDamage);
|
||||
|
||||
/*
|
||||
* Fires bullets from player's weapon.
|
||||
*
|
||||
|
@ -40,8 +40,46 @@ public:
|
||||
|
||||
virtual ~CCSEntity() {}
|
||||
virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker) = 0;
|
||||
virtual void FireBuckshots(ULONG cShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iTracerFreq, int iDamage, entvars_t *pevAttacker) = 0;
|
||||
virtual Vector FireBullets3(Vector &vecSrc, Vector &vecDirShooting, float vecSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand) = 0;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma region reserve_vfuncs_Region
|
||||
#endif
|
||||
virtual void func_reserve1() {};
|
||||
virtual void func_reserve2() {};
|
||||
virtual void func_reserve3() {};
|
||||
virtual void func_reserve4() {};
|
||||
virtual void func_reserve5() {};
|
||||
virtual void func_reserve6() {};
|
||||
virtual void func_reserve7() {};
|
||||
virtual void func_reserve8() {};
|
||||
virtual void func_reserve9() {};
|
||||
virtual void func_reserve10() {};
|
||||
virtual void func_reserve11() {};
|
||||
virtual void func_reserve12() {};
|
||||
virtual void func_reserve13() {};
|
||||
virtual void func_reserve14() {};
|
||||
virtual void func_reserve15() {};
|
||||
virtual void func_reserve16() {};
|
||||
virtual void func_reserve17() {};
|
||||
virtual void func_reserve18() {};
|
||||
virtual void func_reserve19() {};
|
||||
virtual void func_reserve20() {};
|
||||
virtual void func_reserve21() {};
|
||||
virtual void func_reserve22() {};
|
||||
virtual void func_reserve23() {};
|
||||
virtual void func_reserve24() {};
|
||||
virtual void func_reserve25() {};
|
||||
virtual void func_reserve26() {};
|
||||
virtual void func_reserve27() {};
|
||||
virtual void func_reserve28() {};
|
||||
virtual void func_reserve29() {};
|
||||
virtual void func_reserve30() {};
|
||||
#if defined(_MSC_VER)
|
||||
#pragma endregion
|
||||
#endif
|
||||
|
||||
public:
|
||||
CBaseEntity *m_pContainingEntity;
|
||||
};
|
||||
@ -74,4 +112,4 @@ public:
|
||||
|
||||
};
|
||||
|
||||
#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION001"
|
||||
#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION002"
|
||||
|
@ -28,6 +28,10 @@ public:
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
operator ULONG() const
|
||||
{
|
||||
return ULONG(m_value);
|
||||
}
|
||||
operator size_t() const
|
||||
{
|
||||
return size_t(m_value);
|
||||
|
@ -325,6 +325,48 @@ cell AMX_NATIVE_CALL rg_fire_bullets(AMX *amx, cell *params)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fires buckshots from entity.
|
||||
*
|
||||
* @param inflictor Inflictor is the entity that caused the damage (such as a gun)
|
||||
* @param attacker Attacker is the entity that triggered the damage (such as the gun's owner)
|
||||
* @param shots The number of shots
|
||||
* @param vecSrc The source position of the barrel
|
||||
* @param vecDirShooting Shooting direction
|
||||
* @param vecSpread Spread
|
||||
* @param flDistance Max shot distance
|
||||
* @param iTracerFreq Tracer frequency
|
||||
* @param iDamage Damage amount
|
||||
*
|
||||
* @noreturn
|
||||
*
|
||||
* native rg_fire_buckshots(const inflictor, const attacker, const shots, Float:vecSrc[3], Float:vecDirShooting[3], Float:vecSpread[3], const Float:flDistance, const iTracerFreq, const iDamage);
|
||||
*/
|
||||
cell AMX_NATIVE_CALL rg_fire_buckshots(AMX *amx, cell *params)
|
||||
{
|
||||
enum args_e { arg_count, arg_inflictor, arg_attacker, arg_shots, arg_vecSrc, arg_dir, arg_spread, arg_dist, arg_tracefrq, arg_dmg };
|
||||
|
||||
CHECK_ISENTITY(arg_inflictor);
|
||||
CHECK_ISENTITY(arg_attacker);
|
||||
|
||||
CAmxArgs args(amx, params);
|
||||
CBaseEntity *pInflictor = args[arg_inflictor];
|
||||
|
||||
pInflictor->m_pEntity->FireBuckshots
|
||||
(
|
||||
args[arg_shots],
|
||||
args[arg_vecSrc],
|
||||
args[arg_dir],
|
||||
args[arg_spread],
|
||||
args[arg_dist],
|
||||
args[arg_tracefrq],
|
||||
args[arg_dmg],
|
||||
args[arg_attacker]
|
||||
);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fires bullets from player's weapon.
|
||||
*
|
||||
@ -2441,6 +2483,7 @@ AMX_NATIVE_INFO Misc_Natives_RG[] =
|
||||
{ "rg_multidmg_add", rg_multidmg_add },
|
||||
|
||||
{ "rg_fire_bullets", rg_fire_bullets },
|
||||
{ "rg_fire_buckshots", rg_fire_buckshots },
|
||||
{ "rg_fire_bullets3", rg_fire_bullets3 },
|
||||
|
||||
{ "rg_round_end", rg_round_end },
|
||||
|
Loading…
Reference in New Issue
Block a user