Raised This Month: $ Target: $400
 0% 

[SOLVED]Team Limit?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Brreaker
Senior Member
Join Date: Oct 2009
Location: Constanta, Romania
Old 10-12-2009 , 07:41   [SOLVED]Team Limit?
Reply With Quote #1

Hey...I am kinda new to scripting,all I need to know is how can I limit the number of members of a Team...Let's say I want that the CT team has a maximum of 5 persons,that will be randomly chosen when a new round starts...Can you please help me?
I tried with cs_get_user_team and cs_set_user_team but nothing good happened...

Regards,Brreaker.

Last edited by Brreaker; 10-17-2009 at 16:20.
Brreaker is offline
Send a message via MSN to Brreaker Send a message via Yahoo to Brreaker
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-12-2009 , 08:23   Re: Team Limit?
Reply With Quote #2

A fast way is moving everyone to terrorist at the end of the round and then picking random 5 people to be the CTs. You can use functions register_logevent and get_players, just search the forums on those.

Edit: The use of cs_set_user_team is still essential here.
vitorrd is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 10-12-2009 , 08:33   Re: Team Limit?
Reply With Quote #3

WoW
Just search... there are already a good example...
If you can't find look at my previous started threads...
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Brreaker
Senior Member
Join Date: Oct 2009
Location: Constanta, Romania
Old 10-12-2009 , 09:02   Re: Team Limit?
Reply With Quote #4

xBatista...I tried to search,but I found nothing that could help...Vitorrd...Can you help me a little bit?What should I do...Do like if the team of the user is CT he should be automaticaly transfered to T?
Brreaker is offline
Send a message via MSN to Brreaker Send a message via Yahoo to Brreaker
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-12-2009 , 09:09   Re: Team Limit?
Reply With Quote #5

The algorithm is simple, and should happen at the end of the round:

1 - Move everyone to T.
2 - Get the players online (simply use get_players with no flags).
3 - Move 5 random players to CT.

As simple as that.
vitorrd is offline
Brreaker
Senior Member
Join Date: Oct 2009
Location: Constanta, Romania
Old 10-17-2009 , 14:15   Re: Team Limit?
Reply With Quote #6

Solved!Thx vitorrd!+ karma!Topic Lock Please!
Brreaker is offline
Send a message via MSN to Brreaker Send a message via Yahoo to Brreaker
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:35.


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