Open wilianmaique opened 3 years ago
IIRC, it is not a problem. It is bpammo (backpack ammo). That ammo is not dropped with the weapon, it is the ammo that a player has in "inventory".
then, add a cvar so that all the ammo is dropped together.
@wilianmaique Bad idea. Let's say you have usp and mac10 or ump45 (ammo 45acp) and when throwing usp, the player remains without ammo and this raises questions.
you’re playing a mix / pug your ammo runs out, you’ll get a gun and you don’t have bpammo ammo, you have to be like CSGO
no this is not CSGO
finally, if you have how to add a 'cvar' it would be interesting
mp_save_bpammo "inventory" // save to inventory mp_save_bpammo "weapon" // save to weapon
it would be very good for servers from csgomod!
#include <amxmodx>
#include <reapi>
public plugin_init()
{
register_plugin("Drop Weapon With Ammo", "0.1", "Vaqtincha")
RegisterHookChain(RG_CreateWeaponBox, "CreateWeaponBox")
}
public CreateWeaponBox(const pItem, const pPlayer, const modelName[], Float:origin[3], Float:angles[3], Float:velocity[3], Float:lifeTime, bool:packAmmo)
{
for (new pWeapon = NULLENT, ammoType = get_member(pItem, m_iPrimaryAmmoType), InventorySlotType:iSlot = PRIMARY_WEAPON_SLOT; iSlot <= PISTOL_SLOT; iSlot++)
{
pWeapon = get_member(pPlayer, m_rgpPlayerItems, iSlot)
while (pWeapon > 0)
{
if (get_member(pWeapon, m_iPrimaryAmmoType) == ammoType)
{
return
}
pWeapon = get_member(pWeapon, m_pNext)
}
}
SetHookChainArg(8 /* packAmmo */, ATYPE_BOOL, true)
}
only there is no RG_CreateWeaponBox API yet :(
#include <amxmodx> #include <reapi> public plugin_init() { register_plugin("Drop Weapon With Ammo", "0.1", "Vaqtincha") RegisterHookChain(RG_CreateWeaponBox, "CreateWeaponBox") } public CreateWeaponBox(const pItem, const pPlayer, const modelName[], Float:origin[3], Float:angles[3], Float:velocity[3], Float:lifeTime, bool:packAmmo) { for (new pWeapon = NULLENT, ammoType = get_member(pItem, m_iPrimaryAmmoType), InventorySlotType:iSlot = PRIMARY_WEAPON_SLOT; iSlot <= PISTOL_SLOT; iSlot++) { pWeapon = get_member(pPlayer, m_rgpPlayerItems, iSlot) while (pWeapon > 0) { if (get_member(pWeapon, m_iPrimaryAmmoType) == ammoType) { return } pWeapon = get_member(pWeapon, m_pNext) } } SetHookChainArg(8 /* packAmmo */, ATYPE_BOOL, true) }
only there is no RG_CreateWeaponBox API yet :(
n/a plugin
#include <amxmodx> #include <reapi> public plugin_init() { register_plugin("Drop Weapon With Ammo", "0.1", "Vaqtincha") RegisterHookChain(RG_CreateWeaponBox, "CreateWeaponBox") } public CreateWeaponBox(const pItem, const pPlayer, const modelName[], Float:origin[3], Float:angles[3], Float:velocity[3], Float:lifeTime, bool:packAmmo) { for (new pWeapon = NULLENT, ammoType = get_member(pItem, m_iPrimaryAmmoType), InventorySlotType:iSlot = PRIMARY_WEAPON_SLOT; iSlot <= PISTOL_SLOT; iSlot++) { pWeapon = get_member(pPlayer, m_rgpPlayerItems, iSlot) while (pWeapon > 0) { if (get_member(pWeapon, m_iPrimaryAmmoType) == ammoType) { return } pWeapon = get_member(pWeapon, m_pNext) } } SetHookChainArg(8 /* packAmmo */, ATYPE_BOOL, true) }
only there is no RG_CreateWeaponBox API yet :(
n/a plugin
true
problem when picking up weapons from the ground, values other than ammunition,
if you have 10/30 and drop the weapon, if another player picks up the weapon he will only have 10/0
fix the problem.