Raised This Month: $51 Target: $400
 12% 

Remove specific weapon from ground?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 12-21-2010 , 12:53   Remove specific weapon from ground?
Reply With Quote #1

How can I remove a specific weapon from ground it gets dropped? For example an awp.
bibu is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-21-2010 , 14:29   Re: Remove specific weapon from ground?
Reply With Quote #2

Code:
#include <amxmodx> #include <fakemeta>   public plugin_init()         register_forward(FM_SetModel, "SetModel");   public SetModel(ent, model[]) {         if (!equal(model, "models/w_awp.mdl"))                 return FMRES_IGNORED;           // I wonder if remove_entity() would be better in this case         set_pev(ent, pev(ent, pev_flags) | FL_KILLME);           return FMRES_SUPERCEDE; }
__________________
hleV is offline
Old 12-21-2010, 15:52
meTaLiCroSS
This message has been deleted by meTaLiCroSS. Reason: bugbug
vL.
Senior Member
Join Date: Aug 2009
Location: Estonia
Old 12-22-2010 , 07:18   Re: Remove specific weapon from ground?
Reply With Quote #3

How to make it for specific maps, like de_dust2, de_aztec etc.
vL. is offline
Howdy!
Senior Member
Join Date: Feb 2007
Old 12-22-2010 , 07:34   Re: Remove specific weapon from ground?
Reply With Quote #4

Quote:
Originally Posted by vL. View Post
How to make it for specific maps, like de_dust2, de_aztec etc.
Search.
__________________
[IMG]http://img221.**************/img221/5608/howdyfinnishhq2.jpg[/IMG]
Howdy! is offline
vL.
Senior Member
Join Date: Aug 2009
Location: Estonia
Old 12-22-2010 , 07:52   Re: Remove specific weapon from ground?
Reply With Quote #5

I mean, where do I add it to the code?


PHP Code:
public SetModel(entmodel[])
{
    
// here?

    
if (!equal(model"models/w_awp.mdl"))
        return 
FMRES_IGNORED;
    
    
// I wonder if remove_entity() would be better in this case
    
set_pev(entpev(entpev_flags) | FL_KILLME);
    
    return 
FMRES_SUPERCEDE;

vL. is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 12-22-2010 , 08:30   Re: Remove specific weapon from ground?
Reply With Quote #6

Calling a think on a weaponbox is safer I believe.

PHP Code:
call_think(entity
It might be easier if you check which map you are running in plugin_cfg method.
If the map you want to check is returned, pause the plugin.
__________________
It's a mystery.
Mini_Midget is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-22-2010 , 09:23   Re: Remove specific weapon from ground?
Reply With Quote #7

I believe calling think is the best way too, but the current method may also work fine. If you only remove the weaponbox entity, the linked weapon can still remain in the map. You can test all 3 methods to see for sure.
__________________
Bugsy is offline
Howdy!
Senior Member
Join Date: Feb 2007
Old 12-22-2010 , 11:35   Re: Remove specific weapon from ground?
Reply With Quote #8

Quote:
Originally Posted by vL. View Post
I mean, where do I add it to the code?


PHP Code:
public SetModel(entmodel[])
{
    
// here?

    
if (!equal(model"models/w_awp.mdl"))
        return 
FMRES_IGNORED;
    
    
// I wonder if remove_entity() would be better in this case
    
set_pev(entpev(entpev_flags) | FL_KILLME);
    
    return 
FMRES_SUPERCEDE;

Search results will tell that to you. Its like in any other plugin that uses certain maps only.

Doesn't amxx have maps configs to do this also?
__________________
[IMG]http://img221.**************/img221/5608/howdyfinnishhq2.jpg[/IMG]
Howdy! is offline
Reply



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 23:40.


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