Raised This Month: $12 Target: $400
 3% 

TeamSwitch


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Plugin ID:
291
Plugin Version:
1.3
Plugin Category:
Admin Commands
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Allows admins to switch people to the other team or to spectators either now, when they die, or at the end of the round
    Old 02-20-2008 , 08:58   TeamSwitch
    Reply With Quote #1

    This is a fully mod-independent team switching plugin, which gives an admin the ability to switch players to the opposite team either immediately, when they die, or at the end of the round (where appropriate).
    Players can also be switched to spectators.

    TeamSwitch detects which mod it is being run on at startup and configures itself accordingly. In CS:Source, the cstrike extension's function is being used, so the players don't die and don't have to select their model again. In all other mods, the SourceMod API's function is used instead, so players will die if they aren't dead when switched.

    If a dead player is chosen to be switched after death, they will be switched immediately.

    The Admin menu looks like this:




    When selecting "On Death" or "On Round end", the menu will show a flag for players who will be switched, like so:



    The team names will be displayed correctly for each mod, e.g. in TF2 it's "Red" and "Blue".

    If you don't like menus, you can also use these commands:
    • teamswitch <name>
    • teamswitch_death <name>
    • teamswitch_roundend <name>
    • teamswitch_spec <name>
    The plugin has been tested to work with CS:Source, DoD:Source, TF2 and Empires, but it should work for every other Mod as well that uses the same team indices.

    Note:
    Various people have made additions to this plugin and posted them in this thread, e.g. changing player models in CS:S or admin log functionality.


    Changes:
    1.3:
    • teamswitch_spec command added
    1.2:
    • Bugfix: the wrong client IDs were listed in the menu, so the wrong people got selected
    Greetz
    MGee
    Attached Files
    File Type: sp Get Plugin or Get Source (teamswitch.sp - 35078 views - 14.8 KB)
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble

    Last edited by MistaGee; 06-15-2009 at 06:50.
    MistaGee is offline
    Send a message via ICQ to MistaGee
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 02-20-2008 , 18:51   Re: TeamSwitch
    Reply With Quote #2

    Great, the other team switch plugin is a little bugy but works. Can you add a scramble based on players scores and such. Like mp_scrambleteams but scrambles players based on scores to even the teams up a bit so there isnt one good team?
    __________________

    DontWannaName is offline
    MistaGee
    Senior Member
    Join Date: Aug 2004
    Location: Germany (Fulda)
    Old 02-21-2008 , 05:05   Re: TeamSwitch
    Reply With Quote #3

    I've seen the other plugin, but when I looked at the source code trying to figure out what exactly is different in the cstrike edition, I soon gave up because the source code is unreadable.
    That's why I've made my own, mod-independent thing, so I don't have to worry about having different plugins on my servers (I'm running 4 different mods, so...)

    As for the srambling stuff:
    I've thought about it, but I'm not quite sure what's the best way to do it algorithmically. Once I found a good algo, I'll create a new plugin that does it.
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble
    MistaGee is offline
    Send a message via ICQ to MistaGee
    orij1nal™
    Member
    Join Date: May 2006
    Old 02-23-2008 , 11:34   Re: TeamSwitch
    Reply With Quote #4

    This is working great! thanks MistaGee!
    orij1nal™ is offline
    r5053
    SourceMod Donor
    Join Date: May 2007
    Location: Germany
    Old 02-23-2008 , 16:16   Re: TeamSwitch
    Reply With Quote #5

    thx for copying the idea and writing a plugin that do exactly the same like my team switch plugin
    http://forums.alliedmods.net/showthread.php?p=549446
    __________________
    Visit HLPortal.de (this is not my Page)



    Last edited by r5053; 02-24-2008 at 19:14.
    r5053 is offline
    Send a message via ICQ to r5053 Send a message via Skype™ to r5053
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 02-23-2008 , 16:23   Re: TeamSwitch
    Reply With Quote #6

    This plugin doesnt quite work right in TF2. When I ask it to switch a player it switches me instead on the menu lol... I dont know whats wrong.
    __________________

    DontWannaName is offline
    MistaGee
    Senior Member
    Join Date: Aug 2004
    Location: Germany (Fulda)
    Old 02-23-2008 , 16:52   Re: TeamSwitch
    Reply With Quote #7

    Quote:
    Originally Posted by r5053 View Post
    thx for copying my sourcecode without asking
    I wrote the whole code by myself, I didn't copy anything from you.

    Quote:
    Originally Posted by r5053 View Post
    thx for copying the idea and writing a plugin that do exactly the same like my team switch plugin
    Well, the idea isn't that original, and I made my own version because I don't see why a CS:Source edition should be neccessary.

    Quote:
    Originally Posted by DontWannaName View Post
    This plugin doesnt quite work right in TF2. When I ask it to switch a player it switches me instead on the menu lol... I dont know whats wrong.
    That shouldn't happen, I'll definitely check this...

    [edit]
    Sort-of-confirmed, the menu indeed acts a bit weird when there's more than one player in the game. I'll see what I can do.
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble

    Last edited by MistaGee; 03-03-2008 at 15:23.
    MistaGee is offline
    Send a message via ICQ to MistaGee
    r5053
    SourceMod Donor
    Join Date: May 2007
    Location: Germany
    Old 02-23-2008 , 17:19   Re: TeamSwitch
    Reply With Quote #8

    you have a variable on a wrong position contact me than you can use code sniplets to fix it
    __________________
    Visit HLPortal.de (this is not my Page)


    r5053 is offline
    Send a message via ICQ to r5053 Send a message via Skype™ to r5053
    MistaGee
    Senior Member
    Join Date: Aug 2004
    Location: Germany (Fulda)
    Old 02-23-2008 , 18:10   Re: TeamSwitch
    Reply With Quote #9

    The menu was displayed at the wrong item index when being re-displayed, which caused the behavior I noticed when testing.

    I've uploaded a fixed version.
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble
    MistaGee is offline
    Send a message via ICQ to MistaGee
    orij1nal™
    Member
    Join Date: May 2006
    Old 02-23-2008 , 20:48   Re: TeamSwitch
    Reply With Quote #10

    I actually just noticed a bug with the command:

    teamswitch


    It moves me to the opposite team BUT I still have the previous team skin.


    ex. I'm a ct, I teamswitch myself during the round to T but players notice I still have a ct skin even though the scoreboard shows me as a T.
    orij1nal™ is offline
    Reply


    Thread Tools
    Display Modes

    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 22:15.


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