AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Remove specific weapon from ground? (https://forums.alliedmods.net/showthread.php?t=145887)

bibu 12-21-2010 12:53

Remove specific weapon from ground?
 
How can I remove a specific weapon from ground it gets dropped? For example an awp.

hleV 12-21-2010 14:29

Re: Remove specific weapon from ground?
 
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; }

vL. 12-22-2010 07:18

Re: Remove specific weapon from ground?
 
How to make it for specific maps, like de_dust2, de_aztec etc.

Howdy! 12-22-2010 07:34

Re: Remove specific weapon from ground?
 
Quote:

Originally Posted by vL. (Post 1376648)
How to make it for specific maps, like de_dust2, de_aztec etc.

Search.

vL. 12-22-2010 07:52

Re: Remove specific weapon from ground?
 
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;



Mini_Midget 12-22-2010 08:30

Re: Remove specific weapon from ground?
 
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.

Bugsy 12-22-2010 09:23

Re: Remove specific weapon from ground?
 
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.

Howdy! 12-22-2010 11:35

Re: Remove specific weapon from ground?
 
Quote:

Originally Posted by vL. (Post 1376667)
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?


All times are GMT -4. The time now is 10:44.

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