Jump to content

Home

Command for Joining/Spectating?


Zathu Koon

Recommended Posts

Posted

Heya, there are some things I would like to do that involve joing from spectation/going into spectation, however I can not find the (console) command to do these two things.

 

Any help is appreciated.

Posted

I'm just getting into this part of the code aswell, but have only looked briefly. I don't know about changing teams using console commands, but have a look at this function:

 

void ClientBegin( int clientNum, qboolean allowTeamReset ) {

 

which is declared in the g_client.c file. Its does:

 

ent->client->sess.sessionTeam == TEAM_SPECTATOR;

 

and then a bunch of stuff to make the change happen. I'll be looking at this bit of the code in detail once my first stupid problem is out of the way.

 

I'm sure it would be possible to add a console command that invokes a function to change a clients team, which could be made available to scripts etc.

Posted

just from looking at g_cmds.c, it looks like the command to go to spectator mode from the console is just 'spectator'

 

} else if ( !Q_stricmp( s, "spectator" ) || !Q_stricmp( s, "s" ) ) {
	team = TEAM_SPECTATOR;
	specState = SPECTATOR_FREE;

 

It's in the SetTeam module.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...