Raised This Month: $32 Target: $400
 8% 

[REQ] Remove defuse kit from the ground


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kam3n1tza
Member
Join Date: Jul 2011
Old 04-03-2014 , 02:44   [REQ] Remove defuse kit from the ground
Reply With Quote #1

How to edit the code to remove defuse kit from the ground?
All weapons are removed from the ground only defuse kit don't want...

PHP Code:
#include <amxmodx>
#include <fakemeta>

new cvar_removedropped

public plugin_init()
{
    
register_plugin("Remove drop weapons""1.0""watch")

    
register_forward(FM_SetModel"fw_SetModel")

    
cvar_removedropped register_cvar("remove_dropped_weapons""2")
}

public 
fw_SetModel(entity, const model[])
{
    new 
len strlen(model)

    if(
len 8) return

    if (
get_pcvar_float(cvar_removedropped) > 0.0)
    {
        static 
classname[10]
        
pev(entitypev_classnameclassnamecharsmax(classname))
        
        if (
equal(classname"weaponbox"))
        {
            
set_pev(entitypev_nextthinkget_gametime() + get_pcvar_float(cvar_removedropped))
            return
        }
    }

kam3n1tza is offline
Kiske
Veteran Member
Join Date: May 2009
Old 04-03-2014 , 05:56   Re: [REQ] Remove defuse kit from the ground
Reply With Quote #2

This is because the defuse kit hasn't the weaponbox classname.
The classname is item_thighpack.

So, you need to check if the classname is equal to item_thighpack.
__________________


Last edited by Kiske; 04-03-2014 at 05:59.
Kiske is offline
Send a message via Skype™ to Kiske
kam3n1tza
Member
Join Date: Jul 2011
Old 04-03-2014 , 06:58   Re: [REQ] Remove defuse kit from the ground
Reply With Quote #3

Quote:
Originally Posted by Kiske View Post
This is because the defuse kit hasn't the weaponbox classname.
The classname is item_thighpack.

So, you need to check if the classname is equal to item_thighpack.
I tried this way, but still not working:
PHP Code:
#include <amxmodx>
#include <fakemeta>

new cvar_removedropped

public plugin_init()
{
    
register_plugin("Remove drop weapons""1.0""watch")

    
register_forward(FM_SetModel"fw_SetModel")

    
cvar_removedropped register_cvar("remove_dropped_weapons""2")
}

public 
fw_SetModel(entity, const model[])
{
    new 
len strlen(model)

    if(
len 8) return

    if (
get_pcvar_float(cvar_removedropped) > 0.0)
    {
        static 
classname[20]
        
pev(entitypev_classnameclassnamecharsmax(classname))
        
        if (
equal(classname"item_thighpack"))
        {
            
set_pev(entitypev_nextthinkget_gametime() + get_pcvar_float(cvar_removedropped))
            return
        }
    }


Last edited by kam3n1tza; 04-03-2014 at 07:00.
kam3n1tza is offline
Reply


Thread Tools
Display Modes

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 05:04.


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