Raised This Month: $12 Target: $400
 3% 

(Request) Is still impossible to pick up more than 1 weapon?


Post New Thread Reply   
 
Thread Tools Display Modes
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 05-29-2022 , 02:06   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #31

Quote:
Originally Posted by Bugsy View Post
Try the above code now, I left something in that shouldn't be there
It works fine now! thanks!

Last two things and it will be complete:

when buying a 2nd primary weapon make it so it doesnt get dropped on the ground but go directly on inventory or is that hardcoded?


a bug in weapon drop plugin:

i sometimes use bots to fill position when odd players in sv.
can you modify the weapon drop plugin so bots drop weapons too? if they walk over a weapon while carrying one, when they die they wont drop both. and im also not sure it just doesnt disappear when they grab it.
Ark_Procession is offline
SoulWeaver16
Senior Member
Join Date: May 2021
Location: Uruguay
Old 05-29-2022 , 08:30   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #32

Quote:
Originally Posted by Bugsy View Post
Try this for death weapons drop. The plugin I wrote works fine for me..
Spoiler
The plugin works fine, but is there a way to apply it to CZ bots as well?
There is no plugin that does it

Edit: Oh, and is it possible to make it compatible with the NoSil plugin?
The USP and M4A1 are both rolled when buying a new weapon, and you must roll the weapon you bought, grab the USP/M4A1, and then grab the weapon you bought to get both.
For example, the Drop All Weapons On Death plugin takes this into account and works fine

Last edited by SoulWeaver16; 06-03-2022 at 20:12.
SoulWeaver16 is offline
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 06-04-2022 , 01:09   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #33

Quote:
Originally Posted by Bugsy View Post
Try the above code now, I left something in that shouldn't be there
i feel like an ass for saying this, but i am no longer going to use this... the guys did not really got into this after all...

but thanks for all the help as always and hope you can help me in the future since there are requests that i really need help, mostly simple stuff.
Ark_Procession is offline
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 06-05-2022 , 22:35   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #34

Quote:
Originally Posted by Bugsy View Post
Above code is updated. It will remember the exact amount of backpack ammo from the player who dropped the weapon.
Hey Bugsy, do you think you could isolate that part of the code as an individual plugin?

That function was really efficient and solid, and i would love to have it as a separate plugin.
Ark_Procession is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2022 , 22:46   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #35

Of course..
__________________
Bugsy is offline
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 06-11-2022 , 10:54   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #36

Quote:
Originally Posted by Bugsy View Post
Of course..
lol was that true or?...
Ark_Procession is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-11-2022 , 11:52   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #37

Hardly tested
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <hamsandwich>

new const Version[] = "0.1";

enum WeaponSlots
{
    
Slot1 1,
    
Slot2
}
    
public 
plugin_init() 
{
    
register_plugin"Drop BP Ammo with Weapon" Version "bugsy" );
   
    
register_forwardFM_SetModel "SetModel" );
    
RegisterHamHam_AddPlayerItem "player" "AddPlayerItem" );
}

public 
SetModeliEntity , const szModel[] )
{
    new 
szClassname32 ] , iWeaponEntID iWeaponSlot iBPAmmo;
    
    
peviEntity pev_classname szClassname charsmaxszClassname ) );
    
    if ( 
equal szClassname "weaponbox" ) )
    {
        if ( 
pev_valid( ( iWeaponEntID GetWeaponEntityFromWeaponboxiEntity iWeaponSlot ) ) ) )
        {
            if ( ( 
iBPAmmo cs_get_user_bpammopeviEntity pev_owner ) , cs_get_weapon_idiWeaponEntID ) ) ) )
                
set_peviWeaponEntID pev_iuser2 iBPAmmo );
        }
    }


public 
AddPlayerItemiPlayer iEntity )
{
    new 
iBPAmmo peviEntity pev_iuser2 );
    
    if ( 
iBPAmmo )
        
cs_set_user_bpammoiPlayer cs_get_weapon_idiEntity ) , iBPAmmo );
}

GetWeaponEntityFromWeaponboxiWeaponBox , &iWeaponSlot )
{
    new const 
m_rgpPlayerItems_Weaponbox] = { 34 35 , ... };
    new 
iWeaponEntID;

    for ( new 
WeaponSlots:iSlot Slot1 iSlot <= Slot2 iSlot++ )
    {
        if ( ( 
iWeaponEntID get_pdata_cbaseiWeaponBox m_rgpPlayerItems_Weaponbox] + _:iSlot ) ) > )
        {
            
iWeaponSlot _:iSlot;
            break;
        }
    }    
    
    return ( 
iWeaponEntID ) ? iWeaponEntID 0;

__________________

Last edited by Bugsy; 06-11-2022 at 19:39.
Bugsy is offline
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 06-11-2022 , 13:34   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #38

Quote:
Originally Posted by Bugsy View Post
Hardly tested
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <hamsandwich>

new const Version[] = "0.1";

enum WeaponSlots
{
    
Slot1 1,
    
Slot2
}
    
public 
plugin_init() 
{
    
register_plugin"Drop BP Ammo with Weapon" Version "bugsy" );
   
    
register_forwardFM_SetModel "SetModel" );
    
RegisterHamHam_AddPlayerItem "player" "AddPlayerItem" );
}

public 
SetModeliEntity , const szModel[] )
{
    new 
szClassname32 ] , iWeaponEntID iWeaponSlot;
    
    
peviEntity pev_classname szClassname charsmaxszClassname ) );
    
    if ( 
equal szClassname "weaponbox" ) )
    {
        if ( 
pev_valid( ( iWeaponEntID GetWeaponEntityFromWeaponboxiEntity iWeaponSlot ) ) ) )
        {
            
set_peviWeaponEntID pev_iuser2 cs_get_user_bpammopeviEntity pev_owner ) , cs_get_weapon_idiWeaponEntID ) ) );
        }
    }


public 
AddPlayerItemiPlayer iEntity )
{
    new 
iBPAmmo peviEntity pev_iuser2 );
    
    if ( 
iBPAmmo )
    {
        
cs_set_user_bpammoiPlayer cs_get_weapon_idiEntity ) , iBPAmmo );
    }
}

GetWeaponEntityFromWeaponboxiWeaponBox , &iWeaponSlot )
{
    new const 
m_rgpPlayerItems_Weaponbox] = { 34 35 , ... };
    new 
iWeaponEntID;

    for ( new 
WeaponSlots:iSlot Slot1 iSlot <= Slot2 iSlot++ )
    {
        if ( ( 
iWeaponEntID get_pdata_cbaseiWeaponBox m_rgpPlayerItems_Weaponbox] + _:iSlot ) ) > )
        {
            
iWeaponSlot _:iSlot;
            break;
        }
    }    
    
    return ( 
iWeaponEntID ) ? iWeaponEntID 0;

Thanks for your time and effort.

Do you think this or the other version have something in the code that could make the following bug?:

"a primary weapon after firing and getting its clip emptied, it wont reload even if you press R, till you switch to other weapon and back"

can your code possibly cause that, or is there no remote chance and should i look somewhere else?
your expert opinion will help me debug this since that bug does not happen frequently and i am unable to reproduce at will.

Thank you.
Ark_Procession is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-11-2022 , 19:36   Re: (Request) Is still impossible to pick up more than 1 weapon?
Reply With Quote #39

Remove all other 3rd party plugins from plugins.ini and see if it still happens

I also made a slight tweak to the above code, give it a try
__________________

Last edited by Bugsy; 06-11-2022 at 19:39.
Bugsy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode