Raised This Month: $ Target: $400
 0% 

Get weaponbox name?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-24-2015 , 14:55   Re: Get weaponbox name?
Reply With Quote #10

Try this:

Edited to kill weaponbox when it hits the ground instead of when it leaves the players hands.
PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <cstrike>

new const Version[] = "0.1";

public 
plugin_init()
{
    
register_plugin"No Weapon Drop" Version "ConnorMcLeod/bugsy" );

    new class[
32], ent;
    for(new 
iId CSW_P228iId <= CSW_P90iId++)
    {
        if( 
get_weaponname(iId, class, charsmax(class)) )
        {
            
ent create_entity(class);
            if( 
ent )
            {
                if( 
<= ExecuteHam(Ham_Item_ItemSlotent) <= )
                {
                    
RegisterHam(Ham_CS_Item_CanDrop, class, "PrimSec_CanDrop"false);
                }
                
remove_entity(ent);
            }
        }
    }
    
    
register_touch"weaponbox" "worldspawn" "WeaponboxWorldTouch" );
}

public 
PrimSec_CanDropiEntity )
{
    
SetHamReturnIntegerfalse );
    return 
HAM_SUPERCEDE;
}

public 
WeaponboxWorldTouchiWeaponbox iWorld )
{
    if ( 
GetWeaponBoxWeaponTypeiWeaponbox ) != CSW_C4 )
    {
        
call_thinkiWeaponbox );
    }
}

GetWeaponBoxWeaponTypeent 

    new 
weapon
    new const 
m_rgpPlayerItems_CWeaponBox] = { 34 35 , ... };
    new const 
XO_CWEAPONBOX 4;
    
    for(new 
1i<= 5i++) 
    { 
        
weapon get_pdata_cbaseent m_rgpPlayerItems_CWeaponBox] , XO_CWEAPONBOX ); 
        
        if( 
weapon 
        { 
            return 
cs_get_weapon_idweapon ); 
        } 
    } 
    
    return 
0

__________________

Last edited by Bugsy; 10-24-2015 at 18:14.
Bugsy is offline
 



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 22:17.


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