Jump to content

Home

Command for Joining/Spectating?


Zathu Koon

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...