Raised This Month: $ Target: $400
 0% 

just pull out a gun


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andre neves
Junior Member
Join Date: Mar 2011
Old 03-16-2011 , 17:04   just pull out a gun
Reply With Quote #1

I always use the strip to remove weapons from the player but I was wondering if there a way I can just pull out a gun, or just the primary weapons.
andre neves is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2011 , 17:08   Re: just pull out a gun
Reply With Quote #2

http://forums.alliedmods.net/showthr...47#post1109747
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
andre neves
Junior Member
Join Date: Mar 2011
Old 03-16-2011 , 19:06   Re: just pull out a gun
Reply With Quote #3

how do I remove weapons from the number 2?

Last edited by andre neves; 03-16-2011 at 20:23.
andre neves is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-17-2011 , 03:33   Re: just pull out a gun
Reply With Quote #4

Try this :

ham_strip_user_weapon_slot(id, 2)

PHP Code:
ham_strip_user_weapon_slot(idiSlotbool:bSwitchIfActive true
{
    if( !(
<= iSlot <= 5) )
    {
        return 
0
    
}
    const 
XO_PLAYER 5
    
const m_rgpPlayerItems_Slot0 367
    
const m_pActiveItem 373

    
const XO_WEAPON 4
    
const m_pNext 42
    
const m_iId 43

    
new iWeapon get_pdata_cbase(idm_rgpPlayerItems_Slot0 iSlotXO_PLAYER)
    if( 
iWeapon <= )
    {
        return 
// no weapon in this slot
    
}

    new 
iIdpNext
    
while( iWeapon )
    {
        
pNext get_pdata_cbase(iWeaponm_pNextXO_WEAPON)
        
iId get_pdata_cbase(iWeaponm_iIdXO_WEAPON)

        if( 
bSwitchIfActive && pNext <= && get_pdata_cbase(idm_pActiveItemXO_PLAYER) == iWeapon )
        {
            
ExecuteHamB(Ham_Weapon_RetireWeaponiWeapon)
        }

        if( 
ExecuteHamB(Ham_RemovePlayerItemidiWeapon) )
        {
            
user_has_weapon(idiId0)
            
ExecuteHamB(Ham_Item_KilliWeapon)
        }
        
iWeapon pNext
    
}

    return 
1

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 03-17-2011, 10:01
andre neves
This message has been deleted by andre neves.
Reply



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 23:23.


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