Index: src/game/g_admin.c
===================================================================
--- src/game/g_admin.c (revision 966)
+++ src/game/g_admin.c (working copy)
@@ -134,6 +134,11 @@
"reloads the admin config file and refreshes permission flags",
""
},
+
+ {"explode", G_admin_explode, "Q",
+ "cause a player to explode. Caution: damages surrounding players and structures.",
+ "[^3name|slot#^7]"
+ },
{"rename", G_admin_rename, "N",
"rename a player",
@@ -2718,6 +2723,28 @@
return qtrue;
}
+qboolean G_admin_explode( gentity_t *ent, int skiparg )
+{
+
+ int pids[ MAX_CLIENTS ];
+ char name[ MAX_NAME_LENGTH ], err[ MAX_STRING_CHARS ];
+ int minargc;
+ gentity_t *vic;
+
+ minargc = 2 + skiparg;
+
+ if( G_SayArgc() < minargc )
+ {
+ ADMP( "^3!explode: ^7usage: !explode [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!explode: ^7%s\n", err ) );
+ return qfalse;
+ }
+
+ if( !admin_higher( ent, &g_entities[ pids[ 0 ] ] ) )
+ {
+ ADMP( "^3!explode: ^7sorry, but your intended victim has a higher admin"
+ " level than you\n" );
+ return qfalse;
+ }
+
+ vic = &g_entities[ pids[ 0 ] ];
+
+
+ if( vic->client->pers.teamSelection == PTE_NONE || vic->client->pers.classSelection == PCL_NONE )
+ {
+ ADMP( "^3!explode: ^7they must be living to use this command\n" );
+ return qfalse;
+ }
+
+
+ Blow_up(vic);
+
+ return qtrue;
+}
+
qboolean G_admin_rename( gentity_t *ent, int skiparg )
{
int pids[ MAX_CLIENTS ];
Index: src/game/g_admin.h
===================================================================
--- src/game/g_admin.h (revision 966)
+++ src/game/g_admin.h (working copy)
@@ -161,6 +161,7 @@
qboolean G_admin_cancelvote( gentity_t *ent, int skiparg );
qboolean G_admin_passvote( gentity_t *ent, int skiparg );
qboolean G_admin_spec999( gentity_t *ent, int skiparg );
+qboolean G_admin_explode( gentity_t *ent, int skiparg );
qboolean G_admin_rename( gentity_t *ent, int skiparg );
qboolean G_admin_restart( gentity_t *ent, int skiparg );
qboolean G_admin_nextmap( gentity_t *ent, int skiparg );
Index: src/game/g_weapon.c
===================================================================
--- src/game/g_weapon.c (revision 966)
+++ src/game/g_weapon.c (working copy)
@@ -1651,3 +1651,16 @@ void FireWeapon( gentity_t *ent )
}
}
+void Blow_up( gentity_t *ent )
+{
+
+ gentity_t *m;
+
+
+ // set directions
+ AngleVectors( ent->client->ps.viewangles, forward, right, up );
+ CalcMuzzlePoint( ent, forward, right, up, muzzle );
+
+ m = launch_grenade2( ent, muzzle, forward );
+}
+