summaryrefslogtreecommitdiff
path: root/src/game/g_admin.c
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2019-08-12 23:47:55 +0100
committerIronClawTrem <louie.nutman@gmail.com>2019-08-12 23:47:55 +0100
commit3b15646332be36d3dcce9d1326ab3c569a8bedea (patch)
treefcefb60359aa1e0cbdf21c20deea8e7cb7113048 /src/game/g_admin.c
parent44c40fb42519e243a4d7561ac7a9ef8e8096d56e (diff)
add !bubbles command
Diffstat (limited to 'src/game/g_admin.c')
-rw-r--r--src/game/g_admin.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 1cc55b4..7b81696 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -384,7 +384,13 @@ g_admin_cmd_t g_admin_cmds[ ] =
{"astage", G_admin_astage, "stage",
"change the stage for aliens",
"[^3#^7]"
+ },
+
+ {"bubble", G_admin_bubble, "bubble",
+ "continuously spawn bubbles around a player",
+ "[^3name|slot#^7]"
}
+
};
static int adminNumCmds = sizeof( g_admin_cmds ) / sizeof( g_admin_cmds[ 0 ] );
@@ -7528,3 +7534,56 @@ qboolean G_admin_astage( gentity_t *ent, int skiparg )
return qtrue;
}
+
+qboolean G_admin_bubble( gentity_t *ent, int skiparg )
+{
+ int pids[ MAX_CLIENTS ];
+ char name[ MAX_NAME_LENGTH ], err[ MAX_STRING_CHARS ];
+ gentity_t *vic;
+
+ if(g_Bubbles.integer)
+ {
+ if( G_SayArgc() < 2 + skiparg )
+ {
+ ADMP( "^3!bubble: ^7usage: !bubble [name|slot#]\n" );
+ return qfalse;
+ }
+ G_SayArgv( 1 + skiparg, name, sizeof( name ) );
+ if( G_ClientNumbersFromString( name, pids ) != 1 )
+ {
+ G_MatchOnePlayer( pids, err, sizeof( err ) );
+ ADMP( va( "^3!bubble: ^7%s\n", err ) );
+ return qfalse;
+ }
+ vic = &g_entities[ pids[ 0 ] ];
+ if(vic->client->sess.invisible == qtrue)
+ {
+ ADMP( va( "^3!bubble: ^7no connected player by that name or slot #\n" ) );
+ return qfalse;
+ }
+ if( !admin_higher( ent, &g_entities[ pids[ 0 ] ] ) )
+ {
+ ADMP( "^3!bubble: ^7sorry, but your intended victim has a higher admin"
+ " level than you\n" );
+ return qfalse;
+ }
+
+
+ if( vic->client->pers.bubbleTime )
+ vic->client->pers.bubbleTime = 0;
+ else
+ vic->client->pers.bubbleTime = level.time + 500;
+
+ AP( va( "print \"^3!bubble: ^7bubbles %s for %s^7 by %s\n\"",
+ ( vic->client->pers.bubbleTime ) ? "enabled" : "disabled",
+ vic->client->pers.netname,
+ ( ent ) ? G_admin_adminPrintName( ent ) : "console" ) );
+ }
+ else
+ {
+ ADMP( "^3!bubble: ^7sorry, but bubbles have been disabled on this server.\n" );
+ return qfalse;
+ }
+ return qtrue;
+
+}