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

Random Teams


Post New Thread Reply   
 
Thread Tools Display Modes
R@tch3t
Senior Member
Join Date: Sep 2005
Location: Fort Myers Fl.
Old 11-14-2005 , 20:11  
Reply With Quote #11

Nope! Downloaded it yesterday with updated version did the same,in fact when i tested it only 3 of us, it put all 3 of us on the same team
__________________
R@tch3t is offline
atambo
Senior Member
Join Date: Oct 2004
Location: Pittsburgh, PA
Old 11-14-2005 , 20:43  
Reply With Quote #12

hmm I dunno whats wrong grr time to post in the scripting help forums
__________________
atambo is offline
Send a message via AIM to atambo Send a message via MSN to atambo Send a message via Yahoo to atambo
BACARRA
Senior Member
Join Date: Mar 2005
Old 12-12-2005 , 14:58  
Reply With Quote #13

atambo can you make this plugin so that when they connect it will automatically put them in a team so that there is no way for any players to stack team with the possibility of and admin to be able to choose team.
BACARRA is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-12-2005 , 15:19  
Reply With Quote #14

Code:
register_logevent("event_round_end", 2, "0=World triggered", "1=Round_End")
I'm not recommend set team with cs_set_user_team on this event because opponents able to kill after this event (before freezetime) and killer would get teamkill.
VEN is offline
s3r
Senior Member
Join Date: Aug 2007
Old 12-08-2007 , 14:35   Re: Random Teams
Reply With Quote #15

the teams ar not balanced and that sucks when 5 vs 1 get at round start will u fix this?
__________________
PS srr 4 strange enlish
s3r is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 12-08-2007 , 14:41   Re: Random Teams
Reply With Quote #16

The author has not been around for a year...
__________________
M249-M4A1 is offline
s3r
Senior Member
Join Date: Aug 2007
Old 12-09-2007 , 05:57   Re: Random Teams
Reply With Quote #17

then i hope someone will make it to work balanced!
__________________
PS srr 4 strange enlish
s3r is offline
eithe
Junior Member
Join Date: Aug 2013
Old 08-08-2013 , 02:43   Re: Random Teams
Reply With Quote #18

So I needed this for a competition we're having where we are to rank players individually, and wanted a way to even out and randomize the teams so no players have advantages of being on a better/winning team.

But I quickly discovered during testing that allthough it does try to randomize the teams, it looks like be cause of the way the randomization is implemented, sometimes it needs to switch teams twice for a player which seems to result in that the change won't happen until the next round (atleast on cs 1.5 won which we wanted to play).

So I refactored the code a little bit and it seems to work ok now.

Code:
#include <amxmodx>
#include <cstrike>
public plugin_init()
{	
	register_plugin("random teams", "1", "atambo")
	register_cvar("sv_randomteams", "1")
	register_logevent("event_round_end", 2, "0=World triggered", "1=Round_End")
}
public event_round_end()
{
	if(get_cvar_num("sv_randomteams") != 1) return PLUGIN_CONTINUE
	new num, players[32]
	get_players(players,num)
	for(new i=0;i<=num;i++)
	{
		if(!is_user_connected(players[i])) continue
		if(cs_get_user_team(players[i])==CS_TEAM_SPECTATOR) continue
		new rannum = random_num(1,2)
		if(rannum==1) 
		{
			cs_set_user_team(players[i],CS_TEAM_T)
			if(i+2<=num)
			{
				i = i+1
				cs_set_user_team(players[i],CS_TEAM_CT)
			}
			
		}
		else 
		{
			cs_set_user_team(players[i],CS_TEAM_CT)
			if(i+2<=num)
			{
				i = i+1
				cs_set_user_team(players[i],CS_TEAM_T)
			}
		}
	}
	return PLUGIN_CONTINUE
}
Attached Files
File Type: sma Get Plugin or Get Source (randomteams.sma - 418 views - 894 Bytes)

Last edited by eithe; 08-08-2013 at 02:50.
eithe is offline
ENAK3
Member
Join Date: Apr 2013
Old 01-03-2014 , 13:00   Re: Random Teams
Reply With Quote #19

How does the plugin "make sure the teams are even"?
ENAK3 is offline
eithe
Junior Member
Join Date: Aug 2013
Old 01-04-2014 , 03:57   Re: Random Teams
Reply With Quote #20

Quote:
Originally Posted by ENAK3 View Post
How does the plugin "make sure the teams are even"?
What do you mean?
eithe 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 23:15.


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