AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   just pull out a gun (https://forums.alliedmods.net/showthread.php?t=152950)

andre neves 03-16-2011 17:04

just pull out a gun
 
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.

ConnorMcLeod 03-16-2011 17:08

Re: just pull out a gun
 
http://forums.alliedmods.net/showthr...47#post1109747

andre neves 03-16-2011 19:06

Re: just pull out a gun
 
how do I remove weapons from the number 2?

ConnorMcLeod 03-17-2011 03:33

Re: just pull out a gun
 
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




All times are GMT -4. The time now is 16:53.

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