Simple Adminmod Team Change Plugin

j0ej0e Join Date: 2002-11-01 Member: 2840Banned
edited November 2002 in General Server Discussion
<div class="IPBDescription">it just forces a player to change teams</div> <b>new commands:

admin_marine player
admin_alien player</b>

/* copy/pasted from plugin_CS.sma
d_h_johnson@hotmail.com
*/

#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>

#define ACCESS_CHANGE_TEAM 8192

public admin_changeteam(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new TargetName[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new User[MAX_NAME_LENGTH];

convert_string(HLCommand,Command,MAX_NAME_LENGTH);
convert_string(HLData,Data,MAX_NAME_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);

if (check_user(Data) == 1) {
get_username(Data,TargetName,MAX_NAME_LENGTH);
say_command(User,Command,TargetName);
if (check_immunity(TargetName) != 0) {
snprintf(Text, MAX_TEXT_LENGTH, "Laf. You can't move %s onto another team, you silly bear.", TargetName);
messageex(User,Text,print_chat);
} else if (streq(Command,"admin_alien")==1) {
execclient(TargetName, "readyroom;jointeamtwo");
execclient(TargetName, "echo admin has changed your team"); } else if (streq(Command,"admin_marine")==1) {
execclient(TargetName, "readyroom;jointeamone");
execclient(TargetName, "echo admin has changed your team"); }
} else {
selfmessage("Unrecognized player: ");
selfmessage(Data);
}

return PLUGIN_HANDLED;
}

public plugin_init() {
plugin_registercmd("admin_alien","admin_changeteam",ACCESS_CHANGE_TEAM,"admin_alien <target>: Changes target to the alien team.");
plugin_registercmd("admin_marine","admin_changeteam",ACCESS_CHANGE_TEAM,"admin_marine <target>: Changes target to the marine team.");
return PLUGIN_CONTINUE;
}

Comments

  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    <a href='http://www.unknownworlds.com/forums/index.php?act=ST&f=8&t=9915' target='_blank'>Ahem...</a>

    Looks good though
  • j0ej0e Join Date: 2002-11-01 Member: 2840Banned
    yours is better but:

    1) i don't want to try to spell khara/khaara/kharaa/khaaraa when i am in a hurry to move someone. admin_alien is a lot easier for me

    2) you said yours has a bug: "on the scoreboard they change to RR team, but they remain where they were as a marine/kharaa and can just not do anything." so i didn't want to use it

    when you fix that bug, i'll be happy to use yours <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
  • SmellslikefecesSmellslikefeces Join Date: 2002-11-11 Member: 8194Members
    I've been looking for someting like this that would help even teams after someone left. Other plugin gave errors every time I tried to compile it. THanks!!!
  • GoleXGoleX Join Date: 2002-11-07 Member: 7681Members
    Well that bug will teach em to try change teams when I move em! <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->

    It still stops them from changing until those 2 mins are up... just not in the best way yet, hehe.
  • PaegusPaegus Join Date: 2002-11-02 Member: 5306Members
    has anyone gotten logd working properly with NS? i'll admin to being lazy and havent even tried yet... too... much... <!--emo&::skulk::--><img src='http://www.unknownworlds.com/forums/html/emoticons/skulk.gif' border='0' valign='absmiddle' alt='skulk.gif'><!--endemo--> <!--emo&::skulk::--><img src='http://www.unknownworlds.com/forums/html/emoticons/skulk.gif' border='0' valign='absmiddle' alt='skulk.gif'><!--endemo--> <!--emo&::skulk::--><img src='http://www.unknownworlds.com/forums/html/emoticons/skulk.gif' border='0' valign='absmiddle' alt='skulk.gif'><!--endemo-->

    you could add logd functionallity to the am plugin so that a recently chomped/crushed/impaled/shot-the-fug-up player can be auto-switched if the teams become too uneven.

    or prehaps the next release will have some form of auto-balancing enabled. *cough*mp_autobalance*cough*
  • j0ej0e Join Date: 2002-11-01 Member: 2840Banned
    by the way, so far AM on win32 works only with the 1.02 BETA patch, <b>it does not work</b> with the public 1.02 patch
  • MellonpoprMellonpopr Join Date: 2002-11-01 Member: 2304Members
    sadly your right joe <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
  • FlayraFlayra Game Director, Unknown Worlds Entertainment San Francisco Join Date: 2002-01-22 Member: 3Super Administrators, NS2 Developer, Subnautica Developer
    Sorry, I don't know where you're getting your information from, but that's not true.
  • j0ej0e Join Date: 2002-11-01 Member: 2840Banned
    edited November 2002
    my information is from running 1.01 on my server and getting the same crash that i get with 1.02. but the 1.02 beta works with AM fine.

    i showed it to bugblatter - he sent you an email about it <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo--> i'll be happy to send you whatever info i can to help

    here's an adminmod forums post confirming it with other people also the same problem with 1.02

    <a href='http://www.ozforums.com/showthread.php?s=&postid=490470' target='_blank'>http://www.ozforums.com/showthread.php?s=&...=&postid=490470</a>

    (1.02 relevant posts at the bottom)
  • EvilGrinEvilGrin Join Date: 2002-11-04 Member: 6851Members
    <!--QuoteBegin--Paegus+Nov 14 2002, 08:54 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Paegus @ Nov 14 2002, 08:54 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->has anyone gotten logd working properly with NS? i'll admin to being lazy and havent even tried yet... too... much... <!--emo&::skulk::--><img src='http://www.unknownworlds.com/forums/html/emoticons/skulk.gif' border='0' valign='absmiddle' alt='skulk.gif'><!--endemo--> <!--emo&::skulk::--><img src='http://www.unknownworlds.com/forums/html/emoticons/skulk.gif' border='0' valign='absmiddle' alt='skulk.gif'><!--endemo--> <!--emo&::skulk::--><img src='http://www.unknownworlds.com/forums/html/emoticons/skulk.gif' border='0' valign='absmiddle' alt='skulk.gif'><!--endemo--><!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Logd works correctly with 1.02
Sign In or Register to comment.