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

[L4D & L4D2] How to safely swap player team?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
muukis
Veteran Member
Join Date: Apr 2009
Old 01-14-2010 , 08:43   [L4D & L4D2] How to safely swap player team?
Reply With Quote #1

I am matching players by their score and want to shuffle teams based on their score (to make teams even).

I don't know if this works yet, but I hope it does I have some doubts, because I'm not sure if players can swap team to Spectators - Can they? They certainly cannot swap to a team that is already full?

Is there a "best practice" for swapping teams or players?

PHP Code:
// Change Survivors team to Spectators (TEMPORARILY)
for (0GetArraySize(SurvivorArray); i++)
    
ChangeClientTeam(GetArrayCell(SurvivorArrayi), TEAM_SPECTATORS);

// Change Infected team to Survivors
for (0GetArraySize(InfectedArray); i++)
    
ChangeClientTeam(GetArrayCell(InfectedArrayi), TEAM_SURVIVORS);

// Change Spectators (TEMPORARILY) team to Infected
for (0GetArraySize(SurvivorArray); i++)
    
ChangeClientTeam(GetArrayCell(SurvivorArrayi), TEAM_INFECTED); 
__________________
Monster Hunter

Though certainly not superhuman, the man's prowess inspires an excess of whispered rumors. But those rumors remain in the realm of speculation.

Last edited by muukis; 01-14-2010 at 16:04.
muukis is offline
muukis
Veteran Member
Join Date: Apr 2009
Old 01-14-2010 , 15:11   Re: [L4D & L4D2] How to safely seap player team?
Reply With Quote #2

That did not work... We were ghosting as infected and the survivors were at the saferoom at the round start. We ran team shuffle and I kind of got in to the survivors side, but as Hunter. I was ghosting as a Hunter (like I was before team swap) but my GUI was Survivors. I was propably not visible to others as well. I was teleported to the saferoom when the swap took place.

So just by running the ChangeClientTeam did not work for me. What else do I have to give attention to?
__________________
Monster Hunter

Though certainly not superhuman, the man's prowess inspires an excess of whispered rumors. But those rumors remain in the realm of speculation.
muukis is offline
muukis
Veteran Member
Join Date: Apr 2009
Old 01-15-2010 , 07:51   Re: [L4D & L4D2] How to safely swap player team?
Reply With Quote #3

It seems the Infected players don't swap in control of the existing Survivor characters but instead creates new ones. Any ways to put the players in control of the existing survivors? Or can I just execute some command that restarts the map? In the case of restart does the scores get reset? Is there any other (better) methods to restart a map other than console command map <current mapname> <current gamemode>?
__________________
Monster Hunter

Though certainly not superhuman, the man's prowess inspires an excess of whispered rumors. But those rumors remain in the realm of speculation.

Last edited by muukis; 01-15-2010 at 08:26.
muukis is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 01-15-2010 , 11:01   Re: [L4D & L4D2] How to safely swap player team?
Reply With Quote #4

take a look at the current teamswap plugins and see how they do it
Dragonshadow is offline
muukis
Veteran Member
Join Date: Apr 2009
Old 01-15-2010 , 14:29   Re: [L4D & L4D2] How to safely swap player team?
Reply With Quote #5

I think I solved the problem. I was looking at some plugins code and came to conclusion that it required some SDK calls. I'll have to run some tests.
__________________
Monster Hunter

Though certainly not superhuman, the man's prowess inspires an excess of whispered rumors. But those rumors remain in the realm of speculation.
muukis is offline
Downtown1
Veteran Member
Join Date: Mar 2004
Old 01-16-2010 , 02:43   Re: [L4D & L4D2] How to safely swap player team?
Reply With Quote #6

I would just look at the sm_swap* commands from L4D1/L4D2 Score/Team Manager. It's been pretty much the same for 6+ months, it's survived the test of time heh.
Downtown1 is offline
Reply



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 05:56.


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