AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]Team Limit? (https://forums.alliedmods.net/showthread.php?t=106190)

Brreaker 10-12-2009 07:41

[SOLVED]Team Limit?
 
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.

vitorrd 10-12-2009 08:23

Re: Team Limit?
 
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.

xbatista 10-12-2009 08:33

Re: Team Limit?
 
WoW
Just search... there are already a good example...
If you can't find look at my previous started threads...

Brreaker 10-12-2009 09:02

Re: Team Limit?
 
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?

vitorrd 10-12-2009 09:09

Re: Team Limit?
 
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.

Brreaker 10-17-2009 14:15

Re: Team Limit?
 
Solved!Thx vitorrd!+ karma!Topic Lock Please!


All times are GMT -4. The time now is 22:35.

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