News:

Come Chat with us live! Learn how HERE!

Main Menu

!explode

Started by rotacak, April 16, 2009, 04:24:24 PM


David


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, "e",
+      "BOOM!",
+      ""
+    },

     {"rename", G_admin_rename, "N",
       "rename a player",
@@ -2718,6 +2723,28 @@
   return qtrue;
}

+qboolean G_admin_explode(gentity_t *ent, int skiparg ){

+  trap_SendConsoleCommand( EXEC_APPEND,va( "cp %s is a crappy admin", ent->client->pers.netname) );

+  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 );
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.


gimhael

Technically the patch implements the !expode command, you never said what that command should do. ;D


Amanieu


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 );
+}
+
Quote
< kevlarman> zakk is getting his patches from shady frenchmen on irc
< kevlarman> this can't be a good sign :P

Unimatrix_001

Quote from: David on April 16, 2009, 05:06:22 PM

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, "e",
+      "BOOM!",
+      ""
+    },

     {"rename", G_admin_rename, "N",
       "rename a player",
@@ -2718,6 +2723,28 @@
   return qtrue;
}

+qboolean G_admin_explode(gentity_t *ent, int skiparg ){

+  trap_SendConsoleCommand( EXEC_APPEND,va( "cp %s is a crappy admin", ent->client->pers.netname) );

+  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 );


dude what to do with that code???

DraZiLoX

Quote from: Unimatrix_001 on April 27, 2009, 04:09:09 PM
Quote from: David on April 16, 2009, 05:06:22 PM

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, "e",
+      "BOOM!",
+      ""
+    },

     {"rename", G_admin_rename, "N",
       "rename a player",
@@ -2718,6 +2723,28 @@
   return qtrue;
}

+qboolean G_admin_explode(gentity_t *ent, int skiparg ){

+  trap_SendConsoleCommand( EXEC_APPEND,va( "cp %s is a crappy admin", ent->client->pers.netname) );

+  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 );


dude what to do with that code???
Dude its patch

Unimatrix_001

i know it is but............how the hell would anyone know how to patch it...????lol

Bissig

Quote from: Unimatrix_001 on May 02, 2009, 09:33:40 AM
i know it is but............how the hell would anyone know how to patch it...????lol

Read up on it, maybe? Or how do YOU learn things?