Raised This Month: $32 Target: $400
 8% 

Weapon owner


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 11-30-2014 , 06:21   Weapon owner
Reply With Quote #1

For my nightcrawler unlimmited clip,
I tought to make an easy way for it.

Tho easy doesnt always work, sometimes it does, sometime it doesnt.
Any impovements, fix sugguestions?

Thx

PHP Code:
            if(get_pcvar_num(g_pAdrenalineUnlimmitedClip))
            {
                new 
arrayWeapons[32], intWeaponsstrWeaponname[32], intEntity
                get_user_weapons
(idarrayWeaponsintWeapons)
                
                for(new 
0intWeaponsi++)
                {
                    if(
g_iMaxClipAmmo[arrayWeapons[i]])
                    {
                        
get_weaponname(arrayWeapons[i], strWeaponname31)
                        
                        if(
pev_valid( (intEntity engfunc(EngFunc_FindEntityByStringid"classname"strWeaponname)) ))
                        {
                            
cs_set_weapon_ammo(intEntity5000)
                        }
                    }
                }
            } 
__________________
Retired.
Xalus is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 11-30-2014 , 07:50   Re: Weapon owner
Reply With Quote #2

Try this

PHP Code:
new iWpn get_user_weapon(iIndex);
new 
iEnt Retrieve_WeaponEnt(iIndexiWpn);
    
cs_set_weapon_ammo(iEnt5000);

Retrieve_WeaponEnt(iIndexwpnIndex)
{
    static 
szWpn[32];
    
get_weaponname(wpnIndexszWpnsizeof szWpn 1);
    
    new 
iEnt = -1;
    
iEnt fm_find_ent_by_owner(iEntszWpniIndex);
    
    return 
iEnt;

__________________
What are you looking for here?
DavidJr is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-30-2014 , 08:31   Re: Weapon owner
Reply With Quote #3

This is worse.

Just loop with m_rgpPlayerItems.
__________________
Arkshine 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 13:27.


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