Raised This Month: $ Target: $400
 0% 

[ANY] Ent_Delete Plugin (1.3.0)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
PropKiller
Member
Join Date: Nov 2009
Location: South-East USA
Plugin ID:
1814
Plugin Version:
1.3.0
Plugin Category:
Gameplay
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Disables the ent_remove, and creates ent_delete.
    Old 07-18-2010 , 15:26   [ANY] Ent_Delete Plugin (1.3.0)
    Reply With Quote #1



    Description:

    This plug-in is basically for cheat servers, or any server with Sv_cheats to 1.

    I know it works on Hl2:dm, it should work on any server with ent_remove as a command in console.

    What it does, is it disables the use of the command ent_remove, and creates a new command, ent_delete.

    What ent_remove does, is it removes a prop or entity that you are looking at. But.. if someone gets in the way when you are using the command, or someone uses the command on a player, it crashes the server.

    So, what the plug-in does, is that it disables the use of ent_remove command, so that the server won't crash because of it. And it creates a new command, ent_delete. Ent_delete properly deletes props and entities, that you are aiming at. Ent_delete does the job better. If you use ent_delete on a player, it will not crash. It is a really simple plugin, aswell as my first plugin.

    Unless the map/server is ment for people to remove props, guns, and entities, I wouldn't suggest using this plugin.


    Screenshots:

    Server Console:


    Player Chat:


    Installation:
    Place entdelete.smx in your addons/sourcemod/plugins folder.
    Place entdelete.sp in your addons/soucemod/scripting folder.
    Add the line:
    PHP Code:
    sm_remove_disabled 1 
    in your server.cfg

    CVar:
    sm_remove_disabled - (0/1)
    If "0", Ent_delete will be disabled, and Ent_remove will work.
    Console Commands:
    ent_delete - Removes the entity that the player is aiming at.

    Admin Commands:
    sm_delete_all - Removes all the entities with the specified classname. (Kick Flag)

    Disables:
    ent_remove
    ent_remove_all

    Changelog:

    v1.3.0
    • Cleaned code.
    • Updated.

    v1.2.5
    • Changed the way it tells you what you removed.
    • Made it so it prints what was removed and by who, in the server console.
    • Cleaned code.

    v1.2.0
    • Created sm_remove_disabled cvar.
    sm_remove_disabled (0/1)
    Default "1"
    If "0", Ent_delete will be disabled, and ent_remove will work. <- Dunno why I added this.
    • Added what entity you removed. It tells you what entity you removed, when you remove it.
    Ex:
    You spawn an npc_gman.
    Look at it. Type "ent_delete" in console.
    It deletes the gman and prints:
    "(Removed Entity: npc_gman)"

    v1.1.5
    • Created sm_delete_all. Admins with KICK flag can only use it. Sm_delete_all [entity] *Ex
    ample: sm_delete_all prop_dynamic* Removes all entities with specified classname.

    v1.1.0
    • Disabled ent_remove_all to only admins with root access.
    • Lets players know ent_remove is disabled, and ent_delete is the substitute when they try to use ent_remove.

    v1.0.0
    • First release to the public.

    Plans:
    Ent_delete_radius - Admin command that deletes all entities within specified radius. *May or may not be added*

    Known Bugs/Glitches:
    None
    Report a bug/glitch.

    Thanks:
    Exvel: Posted function: FindEntityByClassname2 in the FindEntityByClassname API.
    And, to everyone who helped out in the Scripting forums, and everyone who gave me ideas for new additions.


    Feel free to request things.

    Attached Files
    File Type: sp Get Plugin or Get Source (entdelete.sp - 1693 views - 2.8 KB)

    Last edited by PropKiller; 12-31-2010 at 13:43. Reason: v1.3.0 - Cleaned Code
    PropKiller is offline
    Searcher64
    Senior Member
    Join Date: Apr 2010
    Old 07-18-2010 , 17:08   Re: Ent_Delete Plugin
    Reply With Quote #2

    Can it delete objects in a radius of the location where you executed ent_delete? This would be useful in deleting the error models when you did not put in the proper model name
    Searcher64 is offline
    PropKiller
    Member
    Join Date: Nov 2009
    Location: South-East USA
    Old 07-18-2010 , 18:49   Re: [ANY] Ent_Delete Plugin (1.1.0)
    Reply With Quote #3

    No, it can't. I will look into adding that to the plugin soon. I'll most likely create a new command for that, since ent_delete is for deleting only the entity you are looking at.
    PropKiller is offline
    PropKiller
    Member
    Join Date: Nov 2009
    Location: South-East USA
    Old 07-19-2010 , 11:20   Re: [ANY] Ent_Delete Plugin (1.1.0)
    Reply With Quote #4

    Starting to think I cant make the radius addition. Its gonna be kinda hard, since I have no clue how I would do it. I'd have to search around and possibly post in the scripting forums.
    So, for right now, Ill put a hold on that addition.
    I came up with another idea, while I was trying to mess with the radius stuff. And this is what I came up with.
    sm_remove_all. It works the same as ent_remove_all, except only admins can use it. That should come out tonight or sometime tomorrow.
    PropKiller is offline
    PropKiller
    Member
    Join Date: Nov 2009
    Location: South-East USA
    Old 07-22-2010 , 09:02   Re: [ANY] Ent_Delete Plugin (1.1.0)
    Reply With Quote #5

    Sorry for the lateness on everything. Iv been busy at home with some stuff.

    Any news on this plugin working for CS:S or any other source game?
    PropKiller is offline
    Searcher64
    Senior Member
    Join Date: Apr 2010
    Old 07-22-2010 , 10:43   Re: [ANY] Ent_Delete Plugin (1.1.0)
    Reply With Quote #6

    It should work on any source engine game since it just removes some objects shouldn't it?
    Searcher64 is offline
    Geel9
    Senior Member
    Join Date: Mar 2009
    Old 07-22-2010 , 11:13   Re: [ANY] Ent_Delete Plugin (1.1.0)
    Reply With Quote #7

    Why not just have a plugin that registers ent_remove as a command and then, if the argument is "!picker", it then checks to see if the entity the player is aiming at is a player. If it is, return false.
    Geel9 is offline
    PropKiller
    Member
    Join Date: Nov 2009
    Location: South-East USA
    Old 07-22-2010 , 13:02   Re: [ANY] Ent_Delete Plugin (1.1.0)
    Reply With Quote #8

    @ Searcher64: Yeah, that's what I'm guessing. I'm still waiting for someone to try it on some other source games so I can call it ANY instead of a HL2DM Plugin.

    @ Geel9: Whats the difference? Ent_delete on this plugin works just as good as doing what you said.

    Last edited by PropKiller; 07-22-2010 at 13:42.
    PropKiller is offline
    PropKiller
    Member
    Join Date: Nov 2009
    Location: South-East USA
    Old 07-22-2010 , 13:51   Re: [ANY] Ent_Delete Plugin (1.1.0)
    Reply With Quote #9

    Added:

    Plans:

    Sm_delete_all - sm_delete_all [entity] *Ex: sm_delete_all prop_dynamic* Admin with KICK flag. (Tonight)
    PropKiller is offline
    honorcode23
    BANNED
    Join Date: Mar 2010
    Location: Chile
    Old 07-22-2010 , 14:38   Re: [ANY] Ent_Delete Plugin (1.1.0)
    Reply With Quote #10

    You could add a command to retrieve the entitys name. Instead of like, killing the entity, just retrieve the entity information. Would be usefull to know that the entity is, before deleting it.

    Another thing, if you need to check the entities within a radius, here's a hint of how to do it:

    PHP Code:
    public Action:Command(clientargs)
    {
        
    KillEntities(client)
    }
        
        
    KillEntities(client)
    {    
        new 
    Float:flMaxDistance //Get your convar radius
        
    new tcount 0//Just for info
        
        // define DEBUG at first
        #if DEBUG
        
    new userid GetClientUserId(client);
        
    PrintToConsole(client"Getting position from this client[Index :%i | User Id: %i]"clientuserid);
        
    #endif
        
        //Declare the client's position and the target position as floats.
        
    decl Float:pos[3], Float:tpos[3], Float:distance[3], String:sClassname[256], String:sModel[256];
        
        
    //Get the client's position and store it on the declared variable.
        
    GetClientAbsOrigin(clientpos);
        
    #if DEBUG
        
    PrintToConsole(client"Position for (%i) is: %f, %f, %f"useridpos[0], pos[1], pos[2]);
        
    #endif
        
        //With this, we check for ALL the entities in the game, excluding possible players.
        
    for(new i=MaxClients+1i<=GetMaxEntities(); i++)
        {
            
    //If the entity is invalid, do nothing with this entity and proceed
            
    if(!IsValidEntity(i) || !IsValidEdict(i))
            {
                continue;
            }
            
            
    tcount++; //If the entity passed the filter, increase the targets count for debug info
            
    GetEntityAbsOrigin(itpos); //Get the entity's position in world
            
            //Get the distance between the subject position and the entity position
            
    distance[0] = (pos[0] - tpos[0]);
            
    distance[1] = (pos[1] - tpos[1]);
            
    distance[2] = (pos[2] - tpos[2]);
            
            
    //Get the distance as a radius
            
    new Float:realdistance SquareRoot(FloatMul(distance[0],distance[0])+FloatMul(distance[1],distance[1]));
            
            
    //If the distance is minor or equal to the maximum distance (radius), proceed.
            
    if(realdistance <= flMaxDistance)
            {
                
    //ACTIONS HERE...
            
    }
        }
        
    #if DEBUG
        
    if(tcount 0)
            
    PrintToConsole(client"Targets found: %i"tcount);
        else
            
    PrintToConsole(client"No targets matched");
        
    #endif
        
    tcount 0;
    }
            
            
    //code from another post:
    //http://forums.alliedmods.net/showpost.php?p=885168&postcount=3
    //give credits to the code owner if you use it!
    stock GetEntityAbsOrigin(entityFloat:origin[3])
    {
        if (
    entity && IsValidEntity(entity))
        {
            
    decl Float:mins[3], Float:maxs[3];
            
    GetEntPropVector(entityProp_Send,"m_vecOrigin"origin);
            
    GetEntPropVector(entityProp_Send,"m_vecMins"mins);
            
    GetEntPropVector(entityProp_Send,"m_vecMaxs"maxs);
            
            
    origin[0] += (mins[0] + maxs[0]) * 0.5;
            
    origin[1] += (mins[1] + maxs[1]) * 0.5;
            
    origin[2] += (mins[2] + maxs[2]) * 0.5;
        }

    Hope it helps a bit.
    honorcode23 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 05:15.


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