AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Other way: remove dropped weapons (https://forums.alliedmods.net/showthread.php?t=207218)

alonelive 01-31-2013 04:38

Other way: remove dropped weapons
 
I find a 2 ways on the forum for this issue:

PHP Code:

1. register_forward(FM_SetModel"Fw_SetModel")
2. RegisterHamHam_Touch"weaponbox""WeaponBox_Touch"); 

But they not always appropriate. If you use some plugins as real nade drop or drop all weapons on die and etc. the weapon (or some weapon) still on map...

Need a new way for this. Simple idea:

PHP Code:

public plugin_init() 

        
register_plugin(PLUGINVERSIONAUTHOR

        
set_task((randomnum(1.03.0), "remove_weap"___"b"// do not remove all weapons at once. More realistic! :)


public 
remove_weap()

       
// find a weapon on map (prefix "w_") - i don't know, just a suggest
       // remove weapon from map (it does not matter how it got on the map)
       // INCLUDE: all weapons (shotguns, pistols, snipers, etc), HE, SG, FB nades and shield
       // EXCLUDE: planted / dropped c4, defuse kit

 


Who can help with this?

ConnorMcLeod 01-31-2013 05:34

Re: Other way: remove dropped weapons
 
Link me the plugin i made you to set weapons disappear time and tell me which plugins you are using (drop all weapons on deaths, etc...) and link them.

alonelive 01-31-2013 05:46

Re: Other way: remove dropped weapons
 
Quote:

Originally Posted by ConnorMcLeod (Post 1883970)
Link me the plugin i made you to set weapons disappear time and tell me which plugins you are using (drop all weapons on deaths, etc...) and link them.

Your plugin:
PHP Code:

#include <amxmodx> 
#include <fakemeta> 

#define PLUGIN "Destroy Weapons" 
#define AUTHOR "ConnorMcLeod" 
#define VERSION "0.0.1" 

public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR

    
register_forward(FM_SetModel"SetModel"


public 
SetModel(iEntszModel[]) 

    if( 
equal(szModel"models/w_"9) ) 
    {
        new 
szClassName[2]
        
pev(iEntpev_classnameszClassNamecharsmax(szClassName))
        if( 
szClassName[0] == 'w' // "weaponbox" against "grenade"
        
{
            
set_pev(iEntpev_nextthinkget_gametime() + 10.0)
        }
    } 



Real Nade Drops
by VEN (without 'drop nades on death' function): ____ [ LINK ]
Drop all weapons on death by ConnorMcLeod: __________________________ [ LINK ]
Weapon Physics by Nomexous: _________________________________________ [ LINK ]

And my own plugin (weapon code: fm_give_item, fm_strip_user_weapon)
There are all weapon plugins..


ConnorMcLeod 01-31-2013 05:54

Re: Other way: remove dropped weapons
 
Start to remove any fm_****, not the first time i tel you to do that.

alonelive 02-01-2013 00:31

Re: Other way: remove dropped weapons
 
Quote:

Originally Posted by ConnorMcLeod (Post 1883978)
Start to remove any fm_****, not the first time i tel you to do that.

But what's the point in that? The fm_util of what's wrong?
And fm_give_ ... is not a problem in this topic. The problem is a removing of DROPPED weapon (not given by fm_give).


I'm not a programmer by training, so barely understood the basics. What do I do with this, then?

#define m_flC4Blow 100
#define m_flNextFreqInterval 101
#define m_flNextBeep 102
#define m_flNextFreq 103
#define m_sBeepName 104
#define m_fAttenu 105
#define m_flNextBlink 106
#define m_flNextDefuseCheck 107
#define m_bJustBlew 108............

there are 11 stocks (
some vectors, shields, etc) and #DEFINES. I can not find a useful code for me..


All times are GMT -4. The time now is 20:34.

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