AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Remove Drop Weapons without C4 (https://forums.alliedmods.net/showthread.php?t=216619)

kiryxapro 05-23-2013 10:58

Remove Drop Weapons without C4
 
Hello!I have one problem with plugin "Remove Drop Weapons".This plugin dropped all weapons including C4.I want to this plugin do not dropped C4.How can i realised?

Sma code:
Code:

#include <amxmodx>
#include <fakemeta>
 
new PLUGIN[] = "Remove Drop Weapons"
new VERSION[] = "0.0.2"
new AUTHOR[] = "Athix"
 
new Pcvar_Remove;
new Pcvar_TimeRemove;
new DeleteWeapons;
 
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
     
        Pcvar_Remove = register_cvar("amx_remove_item_dropped", "1")
        Pcvar_TimeRemove = register_cvar("amx_time_to_remove","1.0")
     
        register_forward(FM_SetModel, "Fw_SetModel")
     
        DeleteWeapons = get_pcvar_num(Pcvar_Remove)
}
 
public Fw_SetModel(entity, const model[])
{
        static Float:Timetoremove
        Timetoremove = get_pcvar_float(Pcvar_TimeRemove)
     
        if (DeleteWeapons > 0)
        {
                set_task(Timetoremove, "RemoveItems", entity)
                return;
        }
}
 
public RemoveItems(entity)
{
        static Class[10]
        pev(entity, pev_classname, Class, sizeof Class - 1)
             
        if (equal(Class, "weaponbox"))
        {
                set_pev(entity, pev_nextthink, get_gametime() + DeleteWeapons)
                return;
        }
}


fl0werD 05-23-2013 11:47

Re: Remove Drop Weapons without C4
 
C4 is not weapobox.

kiryxapro 05-23-2013 12:35

Re: Remove Drop Weapons without C4
 
Maybe,but C4 is dropped with this plugin.What to do?

Napoleon_be 05-23-2013 13:15

Re: Remove Drop Weapons without C4
 
check if the player has the C4, if so, give it again after stripping the weapons.

ConnorMcLeod 05-23-2013 13:26

Re: Remove Drop Weapons without C4
 
Search, it has already be done.

Unkolix 05-23-2013 13:50

Re: Remove Drop Weapons without C4
 
Quote:

Originally Posted by Napoleon_be (Post 1956955)
check if the player has the C4, if so, give it again after stripping the weapons.

+ after giving the c4, add these:
PHP Code:

cs_set_user_plantid );
set_pev(idpev_body1); 


Napoleon_be 05-23-2013 14:49

Re: Remove Drop Weapons without C4
 
Quote:

Originally Posted by Unkolix (Post 1956996)
+ after giving the c4, add these:
PHP Code:

cs_set_user_plantid );
set_pev(idpev_body1); 


^

ConnorMcLeod 05-23-2013 16:02

Re: Remove Drop Weapons without C4
 
Guys, it is about removing dropped weapons...

https://forums.alliedmods.net/showth...ight=weaponbox

kiryxapro 05-24-2013 04:50

Re: Remove Drop Weapons without C4
 
Thanks to ConnorMcLeod for this plugin:
https://forums.alliedmods.net/showth...ight=weaponbox

It works!


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

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