summaryrefslogtreecommitdiff
path: root/src/game/g_team.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_team.c')
-rw-r--r--src/game/g_team.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/game/g_team.c b/src/game/g_team.c
index 3f95f533..dec34e9a 100644
--- a/src/game/g_team.c
+++ b/src/game/g_team.c
@@ -63,6 +63,29 @@ team_t G_TeamFromString( char *str )
}
/*
+================
+G_TeamCommand
+
+Broadcasts a command to only a specific team
+================
+*/
+void G_TeamCommand( team_t team, char *cmd )
+{
+ int i;
+
+ for( i = 0 ; i < level.maxclients ; i++ )
+ {
+ if( level.clients[ i ].pers.connected == CON_CONNECTED )
+ {
+ if( level.clients[ i ].pers.teamSelection == team ||
+ ( level.clients[ i ].pers.teamSelection == TEAM_NONE &&
+ G_admin_permission( &g_entities[ i ], ADMF_SPEC_ALLCHAT ) ) )
+ trap_SendServerCommand( i, cmd );
+ }
+ }
+}
+
+/*
==============
OnSameTeam
==============