New Adminmod Plugin

GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
edited November 2002 in General Server Discussion
<div class="IPBDescription">plugin_rdyroom.sma</div> First up, this is my first Adminmod plugin <u>ever</u>, so bare with me if their are some bugs <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->

I originally wanted to create a plugin that would force a person to change teams (when they are stacked). The way NS is currently setup, this is impossible (unless there is some command I don't know about which will change you to a team rather then just take you to the ready room to choose there). So I came up with a compromise... this plugin adds the command admin_rdyroom <nick>. When used, the player "nick" is knocked off his/her team and sent back to the ready room.

Simple enough right? It needs an 8192 access level, and immune players are protected from it.

Try it out and let me know what you think. Also I kinda enjoyed coding this, so let me know if you have any ideas for other NS plugins that I could write.

Thanks,

-GoleX

<b>See page 3 for Auto Team Balancing plugin</b>
«13

Comments

  • SpiritMasterSpiritMaster Join Date: 2002-11-07 Member: 7580Members, Reinforced - Shadow
    edited November 2002
    Compiled your plugin with one error:

    Small compiler 1.5 Copyright © 1997-2000, ITB CompuPhase

    ../include/admin.inc(124) Error [21]: symbol already defined: "plugin_message"

    1 Error.


    you also might want to default the access to level 128 so it is availible along with admin_kick admin_ban ect.. this is easy for somebody to do on their own but...
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    compiles fine on mine oddly... anyway here is the compiled linux version:
  • EpochEpoch Join Date: 2002-10-10 Member: 1474Members
    I haven't looked at it but I assume it execs "readyroom" on the client? If so, after that you can force them to execute "jointeamone" for Marines and "jointeamtwo" for Aliens. That will make them change teams, but no guarantees they'll stay there.
  • NecroNecro &lt;insert non-birthday-related title here&gt; Join Date: 2002-08-09 Member: 1118Members
    yea, or if its 10v8 then it automatically kicks one of the one with more and somehow blocks then off from going back?
  • StoneToadStoneToad Join Date: 2002-11-02 Member: 4053Members, Constellation
    <!--QuoteBegin--Epoch+Nov 9 2002, 11:22 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Epoch @ Nov 9 2002, 11:22 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->I haven't looked at it but I assume it execs "readyroom" on the client? If so, after that you can force them to execute "jointeamone" for Marines and "jointeamtwo" for Aliens. That will make them change teams, but no guarantees they'll stay there.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Great! I only found the readyroom command, jointteamone and jointeamtwo will be great.

    Now I'll always be able to beat the race to your fav team's door <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    There are jointeam commands! Oh sweet mother of mercy, Ima be updating plugin_rdyroom to plugin_nsteams I think. Thanks!!

    And I'll be looking into ways to block people from changing teams for a few minutes after one of the above commands is used to move them (this will be stretching my limited admin mod plugin coding ability, but thats what I live for!)
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    Just finished the new plugin_nsteams.sma ... going to be starting up a server to test it then if all goes well I'll post it.

    It lets you force people to change teams, and then bans them from going back to the ready room or joining a team (if they just try to reconnect) for a set time (I use 2 mins).
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    edited November 2002
    Here is the current .sma ... it does what is required, but the 2 min block from changing back isn't 100 % perfect yet. When people attempt to go back to the Ready Room it "half works" before my plugin blocks it. That is, on the scoreboard they change to RR team, but they remain where they were as a marine/kharaa and can just not do anything. I need to figure out why the entire command is not getting blocked. Any help for this newbie scripter would be appreciated.

    The 3 commands are: admin_rdyroom <nick>; admin_marine <nick>; admin_kharaa <nick>;

    Pretty self-explanatory... enjoy.
  • cracker_jackmaccracker_jackmac Join Date: 2002-11-04 Member: 6891Members, Constellation, Reinforced - Shadow
    i've been using your first plugin (just the rdyroom) and i love it. really helps lower unfair teams because nobody wants to switch to the losing team.

    i have a suggestion. Since i'm not able to babysit and type admin_rdyroom all day. Think you could make either an incrimental or a voted balancing?

    i'm sure i'm not the only one who thought of that.
  • voogruvoogru Naturally Modified (ex. NS programmer) Join Date: 2002-10-31 Member: 1827Members, Retired Developer, NS1 Playtester, Contributor, Constellation
    edited November 2002
    <!--QuoteBegin--Epoch+Nov 9 2002, 06:22 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Epoch @ Nov 9 2002, 06:22 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->I haven't looked at it but I assume it execs "readyroom" on the client? If so, after that you can force them to execute "jointeamone" for Marines and "jointeamtwo" for Aliens. That will make them change teams, but no guarantees they'll stay there.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

    for telling me thoe commands, i been looking for them forever!

    <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    Now i can make my own team change commands <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    (i dont use adminmod)


    Edit:

    w00t w00t

    <!--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-->  else if(FStrEq(Cmd_Argv(1), "team"))
     {
      if(Cmd_Argc() >= 4)
      {
       edict_t *pPlayer = FindPlayerByName(Cmd_Argv(2));
       if (pPlayer != NULL)
       {
        sprintf(msg, "[%s] You have been switched to another team by the server admin.\n", adminname);
        ClientPrint2(pPlayer, HUD_PRINTTALK, msg);
        if(atoi(Cmd_Argv(3)) == 1)
        {
         sprintf(msg, "readyroom;jointeamone");
        }
        else
        {
         sprintf(msg, "readyroom;jointeamtwo");
        }
        v_ClientExec(pPlayer,msg);
       
       }
      }
     }<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    Already had a request for that Cracker... will switch the person with the highest # of frags (thats not comm or gorge) to the opposite team (this is how all auto team balancing functions have worked in the past).

    I'll gets to coding <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->
  • Sgt_Bilko1Sgt_Bilko1 Join Date: 2002-02-02 Member: 150Members
    How many server ops are using this plugin? Have any users complained about auto switch confusing or frustrating them?
  • cracker_jackmaccracker_jackmac Join Date: 2002-11-04 Member: 6891Members, Constellation, Reinforced - Shadow
    <!--QuoteBegin--Sgt. Bilko+Nov 14 2002, 01:21 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Sgt. Bilko @ Nov 14 2002, 01:21 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->How many server ops are using this plugin? Have any users complained about auto switch confusing or frustrating them?<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    I have a few ppl drop after i rdyroom them

    but they aren't regulars. The regulars don't mind at all. And the players really really like it when i get the teams balanced. Because i'm the only fool who switches to the marines when they are losing (btw, held out for another hr that way <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->)

    Players really like the admins abiltiy to even the teams.
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    I had one guy absolutely blow up on me when I moved him teams (chose a random person on Marines and switched em to even teams after asking a few times). Ended up calling me a whole bunch of names, and asking a bunch of people to come with him when he left the server. I kicked him and no one else left <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->
  • Sgt_Bilko1Sgt_Bilko1 Join Date: 2002-02-02 Member: 150Members
    edited November 2002
    Mixed reactions are to be expected I guess. It's hard to judge which person should be moved to another team, not many will go willingly after investing so much time into one side or the other. CS, DOD, TFC, and Firearms are all different, the same level of attachment to each round isn't as high, and being switched only means that you will have different guns and a different viewpoint, the game still plays pretty much the same way.

    My solution to players getting overly iritated at the unexpected auto switch is this. Have a function team_balance or something like that, and when it's activated a timer starts with a message that says "Uneven Teams Detected by Server, __ random player(s) from _____ team will be switched in...) and have the timer count down from 1 minute by sending chat massages every 10 seconds, maybe even repeat the first line a couple times so no one misses it.

    This way people prepare for the switch and it also gives time for people who are willing to switch to make that choice, instead of forcing someone to switch who REALLY doesn't want to.

    Also, how can you switch the best marine player instead of a random player if Marines don't have scores?
  • SuicideDogSuicideDog Join Date: 2002-11-10 Member: 8104Members
    edited November 2002
    hey .. can you instead of moving the highest frag.. move the person with the shortest time on the server.. this is to prevent those llamas that come into the server and see it 5-6 and still join the 6 person team. how often does this check the teams? can I have it run only when I want it to .. so I can use it with a vote system.. or something? And to clarify.. it will only move when there is a 2 person difference right? I use Clanmod and would love to be able to have a cm_task that checks the team stacking and and notifies the user that there will be a forced move if noone switches teams.. or have it all incorporated.. I don't .. just something please <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    ps I know this is a adminmod plugin.. which I have no problem using


    Steve
  • SuicideDogSuicideDog Join Date: 2002-11-10 Member: 8104Members
    Golex .. are you still working on the plugin.. or have you since moved on?
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    Things have been hectic, I'll promise I'll start working on it tonight.

    The hard part is testing it... because I usually have to restart the server, and it full most of the time so I usually wait till the weekend when I can test it in the morning with some friends while the server is empty.
  • SuicideDogSuicideDog Join Date: 2002-11-10 Member: 8104Members
    edited November 2002
    why restart it? can you just re-execute the adminmod.cfg? or am I missing something.. I know I do this for clanmod.. and I think I've done it on adminmod before too!

    I may be wrong.. it happens <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' valign='absmiddle' alt='tounge.gif'><!--endemo--> .. I can help you test too if you like. I'll private msg you my IM's
  • cracker_jackmaccracker_jackmac Join Date: 2002-11-04 Member: 6891Members, Constellation, Reinforced - Shadow
    <!--QuoteBegin--SuicideDog+Nov 15 2002, 05:52 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SuicideDog @ Nov 15 2002, 05:52 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->why restart it? can you just re-execute the adminmod.cfg? or am I missing something.. I know I do this for clanmod.. and I think I've done it on adminmod before too!

    I may be wrong.. it happens <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' valign='absmiddle' alt='tounge.gif'><!--endemo--> .. I can help you test too if you like. I'll private msg you my IM's<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    If your in the game w/ admin rights its just a simple admin_reload

    if your at the console(or rcon) just do <b>admin_command admin_reload</b>
  • SuicideDogSuicideDog Join Date: 2002-11-10 Member: 8104Members
    So any word on the lastest version of this?
  • pakopako Join Date: 2002-11-03 Member: 6681Members
    ahhhh, Im really **obscenity** off.

    I just returned from a server with uneven teams. Nobody wanted to switch.. and I was first in the team, I think I dont have to switch . I asked a long time whoe joined last, but nobody answered....
    .. so I left, because I didnt want to switch teams...(had played Alines long enough) and I this game (no game) is no fun with unfair teams

    <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
    hey .. can you instead of moving the highest frag.. move the person with the shortest time on the server.. this is to prevent those llamas that come into the server and see it 5-6 and still join the 6 person team. how often does this check the teams?
    <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    thats it. The last one that joined the server HAS to move to the other team.

    I think one problem are all the N00b Guides telling ppl to join marines... they dont eve take a look at team numbers....

    PPL if you want to have phun.. MAKE EVEN TEAMS, I think its bad that plugins like this are needed
  • SuicideDogSuicideDog Join Date: 2002-11-10 Member: 8104Members
    well I have my server highly tweaked.. killer pings.. always full.. but.. the only thing it's missing is the autoteam balancer..

    /me pokes at Golex.. anything yet man? need help?
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    edited November 2002
    Its coming... thank god that you are hear to kick my **obscenity** or it'd never get done.

    Its a little more complicated then I orignally planned (so many timers!) so it'll need some testing.

    Once I got it compiled, I'll send it to you to help me test it if you can.

    Thanks
  • SuicideDogSuicideDog Join Date: 2002-11-10 Member: 8104Members
    edited November 2002
    no prob on the testing.. I'm all for it.. my regs are begging for team balancing
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    edited November 2002
    Looks like I am going to have to learn LogD (and all admins that want to use this will have to have it installed). Seems to be the only way to grab the relevant player statistics (like time connected/kills).

    EDIT: Screw it, I'll find a better way <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->
  • cracker_jackmaccracker_jackmac Join Date: 2002-11-04 Member: 6891Members, Constellation, Reinforced - Shadow
    <!--QuoteBegin--SuicideDog+Nov 24 2002, 05:08 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SuicideDog @ Nov 24 2002, 05:08 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->no prob on the testing.. I'm all for it.. my regs are begging for team balancing<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    I'll be more than happy to test it as well......my regulars have been thorough 10 reboots in an hour while i was trying to get something to work. They don't mind once its working.
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    edited November 2002
    Here is the initial beta, with near to zero testing (fixed some obvious flaws). At this point I'm not sure if it works or not... but I know it doesn't break the server or do anything bad, so thats a plus I guess <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->

    Load the plugin, then use the command admin_nsbalance 1 to turn it on. Every 60 seconds it'll check for team imbalance, and if found it will warn the server to even teams. Another 30 seconds later it will scan the player list to determine the candidates for team changing, and then change them to the correct teams to make it even.

    Notice, I had to "hack" the time connected thing, so basically the plugin keeps its own list of players when they connect and disconnect and uses that to determing the times.

    The code is attached. Please do not install this yet unless you are one of the few people that offered to help me test and debug this. A final version may be out by the end of tonight so hold tight.

    EDIT: fixing
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    edited November 2002
    Thanks to the help of SuicideDog, here is a working version of the plugin. You must type admin_nsbalance 1 in the console to turn it on.

    Let me know of any bugs discovered.

    <b>Newer version on Page 4</b>
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    edited November 2002
    <b>Newer version on page 4</b>
Sign In or Register to comment.