[SOLVED] Team checking & random transfer players from one team to another
How can I check players in one team, e.g. terrorist team? I mean if players in terrorist team are less than or equal to 5 10 or 15 to perform a function. Also I would like to know how can I transfer randomly players from one team to another(T->CT)? When I understand how, also I would like to combine this 2 functions, e.g. if( terrorists < 5 ) ---> transfer 2 random players from T team in CT team.
|
Re: Team checking & random transfer players from one team to another
Use get_players to count how many people are on one team. Then you can also use get_players to determine who to send over since you will have a list of players on that team
|
Re: Team checking & random transfer players from one team to another
Hmm that?
PHP Code:
|
Re: Team checking & random transfer players from one team to another
Yes, except you are sending the same person to CT 3 times
|
Re: Team checking & random transfer players from one team to another
Hm, how can I send several terrorists in CT team?
|
Re: Team checking & random transfer players from one team to another
cs_set_user_team(Players[random(Num)], CS_TEAM_CT)
cs_set_user_team(Players[random(Num)], CS_TEAM_CT) cs_set_user_team(Players[random(Num)], CS_TEAM_CT) |
Re: Team checking & random transfer players from one team to another
It is the same. I use:
Code:
id = Players[random(Num)]cs_set_user_team(Players[random(Num)], CS_TEAM_CT) with cs_set_user_team(id, CS_TEAM_CT) |
Re: Team checking & random transfer players from one team to another
It is not the same
|
Re: Team checking & random transfer players from one team to another
Okay, I want to ask something else. Can you tell me how is the correct if/if else form?
PHP Code:
|
Re: Team checking & random transfer players from one team to another
That will work, not sure why you don't just test it yourself
|
| All times are GMT -4. The time now is 15:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.