Plugin Request

devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
<div class="IPBDescription">Edit entities ingame</div> Simply put, I would like a plugin that would allow admins to delete/create entities, in game.
Also, maybe allow admins to remove buildings, without refunding money

I'd prefer AMX or metamod, but I guess I could use adminmod..

Comments

  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    Removing buildings should be easy enough in metamod. How would this work? The admin points at a building a says "/removebuilding"? I suppose the creation of new buildings could be handled in the same way as my ChamberSeeding plugin (i.e. a "ghost" building to position it, then click to place). This sounds interesting. Post an exact description of how you would want this to work, and I'll see what I can come up with.
  • CheesyPetezaCheesyPeteza Join Date: 2002-11-24 Member: 9784Members, NS1 Playtester, Constellation
    edited October 2003
    I can have this done in like 5 minutes.

    Look back in 5 minutes. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif'><!--endemo-->

    EDIT: Oh dunno about creating entities, that might take a bit more work, but removting is easy.
  • CheesyPetezaCheesyPeteza Join Date: 2002-11-24 Member: 9784Members, NS1 Playtester, Constellation
    Here you go, just look at something and say /removebuilding

    Needs the NS2AMX module. Hopefully this points out why the ns2amx module is such a big deal. It means pretty much any plugin you can think of can be created in a very short period of time for amxmod.
  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    Okay, I've only been working on this for a few hours, so it's a little rough around the edges. I'm going to finish it off tomorrow and release it properly then. Currently, it allows you to create any marine building, alien building (including hives), resource nozzles, mines and HA/JP. None of these cost resources; this is by design. To use it, join the game and type "prs_spawn_building x" in the console, where x is any number betwen zero and twenty. This will create a "ghost" building which you can use to position the building. Then, just click to place it (if you've ever used my ChamberSeeding plugin, it's a fairly similar process). If you have any feedback, let me know. Things I already know about:<ul>
    <li>There's no list of which buildings correspond to which number. I'm planning on including a nice menu to allow you to choose what you want to spawn.
    <li>Some buildings are at funny angles (e.g. mines). This will be fixed in the final release.
    <li>Some buildings crash the server when they are build (e.g. alien res nodes).
    <li>Anyone can build. I plan to include the option of only allowing admins to use this in the final version.
    </ul>
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    Wow, thanks both of you..
    I really didn't think it would be done this fast, thanks a lot <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
    Looking at the source for one of them, I may just try a little bith of stuff with AMX and plugins <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->
  • Fl4THeAdFl4THeAd Join Date: 2003-07-30 Member: 18587Members
  • AeaAea Join Date: 2003-10-09 Member: 21552Members
    Yes, you can do anything with that, but it's way too buggy.
  • rknZrknZ Join Date: 2003-10-23 Member: 21885Members
    <!--QuoteBegin--CheesyPeteza+Oct 29 2003, 04:05 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (CheesyPeteza @ Oct 29 2003, 04:05 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Here you go, just look at something and say /removebuilding

    Needs the NS2AMX module. Hopefully this points out why the ns2amx module is such a big deal. It means pretty much any plugin you can think of can be created in a very short period of time for amxmod. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    n00b

    <!--emo&::nerdy::--><img src='http://www.unknownworlds.com/forums/html/emoticons/nerd.gif' border='0' style='vertical-align:middle' alt='nerd.gif'><!--endemo-->
  • DepotDepot The ModFather Join Date: 2002-11-09 Member: 7956Members
    <!--QuoteBegin--Aea+Oct 30 2003, 05:49 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Aea @ Oct 30 2003, 05:49 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Yes, you can do anything with that, but it's way too buggy.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    For the benefit of the builder, could you be a little more specific ??
  • DepotDepot The ModFather Join Date: 2002-11-09 Member: 7956Members
    <!--QuoteBegin--prsearle+Oct 29 2003, 07:27 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (prsearle @ Oct 29 2003, 07:27 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->(if you've ever used my ChamberSeeding plugin, it's a fairly similar process). <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Not to stray off topic, but did a final version ever come out on this that works?
  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    edited October 2003
    Ok, a quick update. I've just got in from Uni, and I'm working on the plugin now. Expect a final release sometime later tonight. I'm adding the ability to restrict use to admins, a nice menu system to choose buildings, the ability to electrify buildings, and (maybe) the ability to upgrade buildings (e.g. upgrade obs to motion tracking... dependson how things work out).

    kwikloader: the latest version of ChamberSeeding is 3.5 and is available from www.modns.org. I've had conflicting reports about it's stability; some people are having problems with it, but most arn't. I'll likely release an update to fix a few issues that have cropped up once NS2.1 is released.

    <b>EDIT: </b>Okay, the plugin is available <a href='http://www.modns.org/forums/index.php?act=ST&f=4&t=138' target='_blank'>here</a>. Electrifying and upgrading buildings didn't make it in, but the admin restrict/menu system did. Some buildings will cause crashes; these are clearly marked.
  • LethyLethy Join Date: 2002-11-07 Member: 7666Members, Constellation
    Any chance of being able to restrict different functions to different WonIDs/SteamIDs, so effectively a group of admins could be given access to the remove entity function, but a different group of admins (or no admins at all) could be given access to the add entity function?

    Or a metamod plugin which just removes entities? I'm very interested in using this plugin so I can give other co-admins the ability to deal with buildings that are built in 'exploitable' places, but on the other hand I do not wish to give the ability to add entities.
  • scottlscottl Join Date: 2002-12-20 Member: 11232Members
    Removing entities is not a good idea unless the person using it has experience and knowledge with it <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif'><!--endemo--> (simply put)

    You can do some funky things that screw things over till map changes(such as removing a ComChair?), or cause crashes.

    Even send players into there own funky domain by removing there player entity. Its juse wacky and something that you should only allow yourself as the server admin to use if any.

    Bottom line, there is just no reason to have a ingame entity remover except for fun, but even then its not that much fun...

    But GL and watch what you remove <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->
  • CheesyPetezaCheesyPeteza Join Date: 2002-11-24 Member: 9784Members, NS1 Playtester, Constellation
    Yeah true you can really mess things up. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->

    I removed a hive and it was gone completely, even next round.

    Its good for removing an oc blocking an resource nozzle though. Or if your server doesn't allow people to build outside on hera.
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    Hm, can someone help me with this plugin..
    It does nothing it all, no prints, no tooltips, no nothing..
    It does show up when I do amx plugins

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->#include <amxmod>
    #include "ns2amx.inc"
    /*
    By Devicenull
    darkmage@snet.net
    Version 0.1
    Limit Onos Res

    CVars:
    mp_limitonosres <n> limit onos res to that number, defualt 6
    Less then 6 is not reccommended, otherwise the onos cannot get any upgrades

    Todo:
    *Distribute Removed Res to Gorges on the same team
    *Possibly add giveres functions as well
    */
    public plugin_init() { //Sets info about the plugin
    register_plugin("Limit Onos Res","0.1","Devicenull") //Give the plugin a name, version, and author
    register_cvar("mp_limitonosres","6") //Limit the amount of res an onos can have, defualt 6
    //register_cvar("mp_giveres","1") //Enable giving of res to a player
    //register_clcmd("say giveres","giveres") //Register the giveres command, so we can use it
    //register_clcmd("team_say giveres","giveres") //Register the giverres command, so we can use it
    set_task(1.0,"removeonosres") //Check the onoses res every second
    }

    public client_putinserver(id) { //Occurs when someone enters the server
    onosresmsg(id) //Display the onos res tooltip
    }



    public removeonosres() {
    new maxonosres //Read from cvar, mp_limitonosres.. the max res an onos can have
    maxonosres = get_cvar_num("mp_limitonosres") //Get the value of mp_limitonosres
    if (maxonosres > 0) { //If the plugin is enabled (anything higher then 0)
     new pnum //Number of Players in game
     new pcount //Loop counter, checking which players are onos
     pnum = get_playersnum(0) //Set the number of players
     if (pnum > 0) {
      for(pcount=0; pcount==pnum; pcount = pcount+1) { //Start the loop
       client_print(pcount,print_center,"We are looping")
       if ( get_class(pcount) == 5) { //If the player is onos
        if ( get_res(pcount) > maxonosres) { //And they have more then maxonosres res
         ns2amx_setres(pcount,maxonosres) //Set their res back to maxonosres
        }
       }
      }
     }
    }
    }

    public onosresmsg(id) { //Display the message about limiting onos res
    new maxonosres //Max res an onos can have
    maxonosres= get_cvar_num("mp_limitonosres") //Get the max onos res
    if ( maxonosres ) { //If the plugin is enabled
    //new onoscheckstring //Max res, converted to a string
    //new msgstring[189] //The tooltip msg
    //ns2amx_string(onoscheck,onoscheckstring) //Convert the number of res to a string
    //copy(msgstring,189,"This server disallows gathering res as onos, you are allowed") //& maxonosres & " res as onos, more then that will be removed.")
    ns2amx_nspopup(id,"Onosteststring") //Display the tooltip
    }
    }
    <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    <span style='font-size:19pt;line-height:100%'>DON'T EVEN START ARGUING ABOUT IF I SHOULD BE DOING THIS, I REALLY DONT CARE WHAT YOU THINK</span>
  • CheesyPetezaCheesyPeteza Join Date: 2002-11-24 Member: 9784Members, NS1 Playtester, Constellation
    I haven't tried it out, but just form reading it I suspect its your for loop.

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1--> for(pcount=0; pcount==pnum; pcount = pcount+1) { //Start the loop
    <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    The first parameter is run when loop first starts, so pcount=0. The second one means keep doing this loop while this parameter is true pcount==pnum. That should be pcount<=pnum. Also for the last parameter you can just do pcount ++ and it will do the same thing.

    Its generally accepted to use the letter i in loops and to initalize the variable in the loop. I dunno why they picked i, but they did and everyone does it so it makes things easier to read if you follow what everyone else does. It would look like this:

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->for(new i = 0; i <= pnum; i++)<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
  • sawcesawce Join Date: 2002-12-14 Member: 10787Members
    edited October 2003
    Also, the nspopup is awkward at times. Sometimes a string of characters won't show up, there's nothing I can do about it. Generally it won't show up if you have a semi-long line of characters only, such as:

    ns2amx_nspopup(id,"Onosteststring") //Display the tooltip

    <b>Edit:</b> Looking at it now, btw. From an early guess it looks like a problem with the cvar.
  • sawcesawce Join Date: 2002-12-14 Member: 10787Members
    edited October 2003
    Ok, here you go.

    Here's the problems you had:

    Your cvar only had a string value. cvar_get_num returns the floatround() of it's float value, I believe.
    Your set_task was only set to be issued one time. It wouldn't loop like it was supposed to.
    Your loop was ... awkward (what cheesy said earlier)
    I don't think put in server was the best spot for that popup, I moved it to when the player evolves into onos.
    I couldn't get copy() to work properly, so it displays a general message. Maybe a consgreet would be more appropriate.
    Also, you were using ns2amx_string() improperly. HL Stores it's strings in PEV data as integers, and string will take that integer and convert it to string format. It's not likely you'll need it outside of PEV strings.

    <b>Edit:</b> By the way, I think this plugin would have great potential. Especially if you made the extra resources overflow into the other teammates. Make that res hoarder first onos actually do the team some good in an indirect way.
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    edited November 2003
    Okay, Im working on version 0.2 which will split the res, I have a few questions about this though
    Seems to work fine now, I can't test it..
    I'm gonna start a <a href='http://www.unknownworlds.com/forums/index.php?act=ST&f=8&t=52275' target='_blank'>new thread</a> about this, but i have a question first.. after a "return", does the sub halt?

    I have <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->get_teams(ateam)
    {
    new pnum = get_playersnum() -1
    new palien = 0
    new pmarine = 0
    for (new i=0; i<=pnum; i++) {
     if (get_entdat_i(i,eni_team) == 2) {
      palien++
     }
     if (get_entdat_i(i,eni_team) == 1) {
      pmarine++
     }
    }
    if (ateam == 1) {
     return pmarine
    }
    if (ateam == 2) {
     return palien
    }
    return 0
    }<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
    That should return the number of players to a team, correct? but will it then return 0 too?
    And, I have a bunch of stuff like this, can I put this into an include, and have the server not be required to run another dll? And what would the format be for the include?

    Also, with get_type, is there any way I could code something that allowed me to use onos, skulk, gorge, etc instead of numbers? The only way I see is making another get_type2 that substitues the correct number I see the enums in the ns2amx.inc file, can I use this for the different classes?
  • CheesyPetezaCheesyPeteza Join Date: 2002-11-24 Member: 9784Members, NS1 Playtester, Constellation
    You should really ask these questions at the <a href='http://amxmod.net/forums/viewforum.php?f=40' target='_blank'>AMX Scripting Support Forum</a>. You will get more help there. I can answer half your question I think.

    return will cause it to exit and not carry on. So if it returns 0 then it means they are not alien or marine. Which is fine.

    As for get_type2, I don't think it is possible. I tried to do the same thing myself. But after lots of searching the AMX forums I came to the conclusion you cannot return strings. You would have to make some global strings and change them. If you look at my teamres plugin you can see how I handled getting their class.

    I don't know what you mean about not having to run another dll?

    You should use else if below as it can only be one or the other. Plus why get_playersnum()-1? If anything I'd add 1 to it as I have a feeling its not always accurate.

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1--> if (get_entdat_i(i,eni_team) == 2) {
     palien++
    } else if (get_entdat_i(i,eni_team) == 1) {
     pmarine++
    }<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
  • sawcesawce Join Date: 2002-12-14 Member: 10787Members
    edited November 2003
    Also, though I've not tried it, it should work.

    The way half-life handles strings in PEV data is by converting it to an integer. The ns2amx module allows you to convert strings->integers and vice versa. You could try something like:

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    public get_class2(id)
    {
    if (get_class(id) == 1)
    {
    return ns2amx_make_string("Skulk")
    }
    else if (get_class(id) == 2)
    {
    return ns2amx_make_string("Gorge")
    }
    }
    <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    And then in the script you would do something such as this:
    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    public show_class(id)
    {
    new svClass[32]
    ns2amx_string(get_class2(id),svClass)
    client_print(id,print_console,"Your class is: %s",svClass)
    }
    <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    Like I've said, I haven't tested it, but in theory, this method should work.

    <b>Edit:</b> btw, this is some pretty big hijacking of your own thread. If you have any more ns2amx questions, please PM me on the modns forums, IRC, or on these forums. If you have general AMX questions, ask cheesy or post on the amx forums, please.
Sign In or Register to comment.