AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   autojoin teams (https://forums.alliedmods.net/showthread.php?t=50226)

Major__ 01-21-2007 23:36

autojoin teams
 
Hi all.

have been trying to use cs_set_user_team, Is there some reason why it wont work :

client_connect ( id ){
cs_set_user_team(id, 1)
}


?

It works if the player is on some team allready, but how can i set the team when he/she joins?

SweatyBanana 01-21-2007 23:51

Re: autojoin teams
 
PHP Code:

public client_putinserver(id)
          
//... 

Other than that, search.

s p l i t 01-22-2007 02:13

Re: autojoin teams
 
With the client_connect forward they are not yet fully into the server.

dutchmeat 01-22-2007 05:08

Re: autojoin teams
 
so that will be:

Code:

public client_putinserver(id){
cs_set_user_team(id, 1)
}



client_putinserver is called after clientconnect, at the same time that 'clientbegin' is called(quake engine), it's around the same time when the client starts to see the motd screen/ choosing of the teams.

Major__ 01-22-2007 05:18

Re: autojoin teams
 
Ah! thank you...

I was fooling around with client_cme(id, "chooseteam;select 1") for a while there :D

dutchmeat 01-22-2007 05:34

Re: autojoin teams
 
Quote:

Originally Posted by Major__ (Post 430166)
Ah! thank you...

I was fooling around with client_cme(id, "chooseteam;select 1") for a while there :D

That solution can be 'hacked/work around' if the client knows that the server has such a plugin,
It can repeatly press the '2' button or whatever the button may be for selecting a team.
that's why you should use cs_set_user_team,instead of 'chooseteam'. Unless the plugin isn't meant for counterstrike, then there are other solutions.

Major__ 02-06-2007 20:09

Re: autojoin teams
 
Ok, taking this one step further...

I can place the players in T or CT as i wish using cs_set_user_team, however hlds thinks they are still in spec/unasigned. ive been trying user_kill, user_silentkill and spawn.

This is how i want it: the user connects, he gets the first motdscreen. clicks OK and the team selection menu is NOT shown, he is placed directly in a team. Anyone know how i can accomplish this?


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

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