AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Exclude ladders from Entity Map Control (https://forums.alliedmods.net/showthread.php?t=334864)

Moonrider 10-24-2021 06:55

Exclude ladders from Entity Map Control
 
Hello! I am using this plugin to remove some of the entities in maps.
However, this plugin removes the ladders models too. Is it possible to exclude the ladders from the plugin and leave them in maps?

Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <engine>

#define PLUGIN ""
#define VERSION "0.0.1"
#define AUTHOR "SpeeDeeR@amxmodxbg"

new const skipp[][] = {
        "info_player_deathmatch",
        "info_player_start",
        "BCM_ServerFrame",
        "BCM_Hud"
};

public plugin_init() {
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        new classname[32];
       
        new bool: skip;
       
        new count = 0;
       
        static victim =-1
        while((victim = engfunc(EngFunc_FindEntityInSphere, victim, Float:{0.0, 0.0, 0.0}, 10000.0)))
        {
                pev(victim, pev_classname, classname, charsmax(classname));
               
                for(new i=0;i<sizeof(skipp);i++) {
                        if(equal(skipp[i],classname))  {
                                skip = true;
                                break;
                        }
                }
               
                if(!skip) {
                        remove_entity(victim);
                       
                        count++;
                }
               
                skip = false;
        }
       
        server_print("%d entities cleared!", count);
}

Thanks in advance!

DJEarthQuake 10-24-2021 07:22

Re: Exclude ladders from Entity Map Control
 
Code:
new const skipp[][] = {     "info_player_deathmatch",     "info_player_start",     "BCM_ServerFrame",     "BCM_Hud",     "func_illusionary",     "func_ladder",     "func_wall" };
"func_illusionary" can be set to lava, slime, water, ladder so I put that in also.

Moonrider 10-24-2021 09:28

Re: Exclude ladders from Entity Map Control
 
Thank you very much! That was exactly what I needed.

DJEarthQuake 10-24-2021 12:28

Re: Exclude ladders from Entity Map Control
 
You're welcome. Add to the list, as needed.

Moonrider 10-24-2021 13:23

Re: Exclude ladders from Entity Map Control
 
It's weird tho on some maps (the default ones like nuke, inferno) the ladders are there but they are invisible.

in floppytown for example everything works fine. Am I missing something? :wink::wink:

DJEarthQuake 10-24-2021 14:10

Re: Exclude ladders from Entity Map Control
 
Try adding func_wall. De_inferno utilizes it a lot.

Moonrider 10-25-2021 12:54

Re: Exclude ladders from Entity Map Control
 
That was the case thanks! de_nuke and inferno use func_wall for their ladders I guess..
Thank you very much. Is there any source to look at all entity names and properties?

Thanks one more time!

DJEarthQuake 10-26-2021 09:03

Re: Exclude ladders from Entity Map Control
 
Mappers have their reasons. Can go into the bsp with nano or edit.com <---that's not a WWW. Notepad is liable to toast the BSP. There are programs like entity info that can do this in-game by attacking the objects it dumps it in console. Can see it all without being in-game loading map with this in a separate log file.

Code:
#include amxmodx #include engine #include engine_stocks #define MAX_NAME_LENGTH 32 #define MAX_CMD_LENGTH 128 #define charsmin        -1 public plugin_init()register_plugin("Keyvalue logger", "1.0", ".sρiηX҉."); public pfn_keyvalue( ent ) {     new Classname[  MAX_NAME_LENGTH ], key[ MAX_NAME_LENGTH ], value[ MAX_CMD_LENGTH ]     copy_keyvalue( Classname, charsmax(Classname), key, charsmax(key), value, charsmax(value) )     log_to_file "map_ent_details.txt", "%s %s %s", Classname, key, value }


All times are GMT -4. The time now is 11:36.

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