Raised This Month: $ Target: $400
 0% 

Get weaponbox name?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-23-2015 , 16:02   Re: Get weaponbox name?
Reply With Quote #2

If you want to block "drop" command then hook it and do your checks. Your way is just removing the box when it is spawned, while you could block it from being created.
Also, don't set FL_KILLME flags on a weaponbox, just make it to think.

Now, about your code:
The classname of an weaponbox entity is, guess what, "weaponbox". pev_classname will always give this in this case. To know if a weaponbox contain a specific weapon you could redo the CWeaponBox::HasWeapon function
(https://github.com/Arkshine/CSSDK/bl...pons.cpp#L1641). Or use this stock made by Connor(which is more or less the same thing):

PHP Code:
GetWeaponBoxWeaponTypeent 

    new 
weapon
    for(new 
1i<= 5i++) 
    { 
        
weapon get_pdata_cbase(entm_rgpPlayerItems_CWeaponBox[i], XO_CWEAPONBOX); 
        if( 
weapon 
        { 
            return 
cs_get_weapon_id(weapon); 
        } 
    } 

    return 
0

Then you can do:
PHP Code:
new WeaponId GetWeaponBoxWeaponType(WeaponBox)
if(
WeaponId == CSW_C4)
{
    

__________________

Last edited by HamletEagle; 10-23-2015 at 16:03.
HamletEagle 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