New Adminmod Plugin
GoleX
Join Date: 2002-11-07 Member: 7681Members
<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>
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>
Comments
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...
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-->
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!)
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).
The 3 commands are: admin_rdyroom <nick>; admin_marine <nick>; admin_kharaa <nick>;
Pretty self-explanatory... enjoy.
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.
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-->
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-->
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.
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?
ps I know this is a adminmod plugin.. which I have no problem using
Steve
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.
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
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>
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
/me pokes at Golex.. anything yet man? need help?
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
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-->
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.
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
Let me know of any bugs discovered.
<b>Newer version on Page 4</b>