Raised This Month: $ Target: $400
 0% 

Solved Only 1 C4 [Strip if Multiple C4's]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-17-2021 , 23:14   Re: Only 1 C4 [Strip if Multiple C4's]
Reply With Quote #6

Not tested and I'm tired, so I can't guarantee it's 100%.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"
#define PLUGIN ""

new GotTheBomb

public plugin_init()
{
        
register_plugin(PLUGINVERSION"iceeedR")
        
register_event("HLTV","EventNewRnd""a""1=0""2=0")
}

public 
EventNewRnd()
{
        
GotTheBomb 0
        
new iPlayers[MAX_PLAYERS],iNumid
        get_players_ex
(iPlayersiNumGetPlayers_ExcludeHLTV GetPlayers_ExcludeBots GetPlayers_MatchTeam"TERRORIST")

        for(new 
iiNum;i++)
        {
                
id iPlayers[i]

                if (!(
user_has_weapon(idCSW_C4)))
                        continue

                
GotTheBomb ++

                if(
GotTheBomb 1)
                {
                        
ham_strip_user_weapon(idCSW_C4)
                        break
                }
        }
}

// stock made by drekes (removed from stripweapons.inc)
stock ham_strip_user_weapon(idiCswIdiSlot 0bool:bSwitchIfActive true)
{
        new 
iWeapon
        
if( !iSlot )
        {
                static const 
iWeaponsSlots[] = {
                        -
1,
                        
2//CSW_P228
                        
-1,
                        
1//CSW_SCOUT
                        
4//CSW_HEGRENADE
                        
1//CSW_XM1014
                        
5//CSW_C4
                        
1//CSW_MAC10
                        
1//CSW_AUG
                        
4//CSW_SMOKEGRENADE
                        
2//CSW_ELITE
                        
2//CSW_FIVESEVEN
                        
1//CSW_UMP45
                        
1//CSW_SG550
                        
1//CSW_GALIL
                        
1//CSW_FAMAS
                        
2//CSW_USP
                        
2//CSW_GLOCK18
                        
1//CSW_AWP
                        
1//CSW_MP5NAVY
                        
1//CSW_M249
                        
1//CSW_M3
                        
1//CSW_M4A1
                        
1//CSW_TMP
                        
1//CSW_G3SG1
                        
4//CSW_FLASHBANG
                        
2//CSW_DEAGLE
                        
1//CSW_SG552
                        
1//CSW_AK47
                        
3//CSW_KNIFE
                        
//CSW_P90
                
}
                
iSlot iWeaponsSlots[iCswId]
        }

        const 
XTRA_OFS_PLAYER 5
        
const m_rgpPlayerItems_Slot0 367

        iWeapon 
get_pdata_cbase(idm_rgpPlayerItems_Slot0 iSlotXTRA_OFS_PLAYER)

        const 
XTRA_OFS_WEAPON 4
        
const m_pNext 42
        
const m_iId 43

        
while( iWeapon )
        {
                if( 
get_pdata_int(iWeaponm_iIdXTRA_OFS_WEAPON) == iCswId )
                {
                        break
                }
                
iWeapon get_pdata_cbase(iWeaponm_pNextXTRA_OFS_WEAPON)
        }

        if( 
iWeapon )
        {
                const 
m_pActiveItem 373
                
if( bSwitchIfActive && get_pdata_cbase(idm_pActiveItemXTRA_OFS_PLAYER) == iWeapon )
                {
                        
ExecuteHamB(Ham_Weapon_RetireWeaponiWeapon)
                }

                if( 
ExecuteHamB(Ham_RemovePlayerItemidiWeapon) )
                {
                        
user_has_weapon(idiCswId0)
                        
ExecuteHamB(Ham_Item_KilliWeapon)
                        return 
1
                
}
        }

        return 
0

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 01-17-2021 at 23:14.
iceeedr is offline
Send a message via Skype™ to iceeedr
 



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 00:50.


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