Author Topic: !explode  (Read 7329 times)

rotacak

  • Posts: 761
  • Turrets: +39/-64
!explode
« on: April 16, 2009, 04:24:24 pm »
Hi, can anyone give me patch with !explode command?

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: !explode
« Reply #1 on: April 16, 2009, 05:06:22 pm »
Code: [Select]
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.

rotacak

  • Posts: 761
  • Turrets: +39/-64
Re: !explode
« Reply #2 on: April 16, 2009, 05:11:34 pm »
David: why you giving me something what I don't want?

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: !explode
« Reply #3 on: April 16, 2009, 05:17:22 pm »
Technically the patch implements the !expode command, you never said what that command should do. ;D

rotacak

  • Posts: 761
  • Turrets: +39/-64
Re: !explode
« Reply #4 on: April 16, 2009, 05:25:59 pm »
Aha. Thanx for help for more mods then.

Amanieu

  • Posts: 647
  • Turrets: +135/-83
    • Amanieu
Re: !explode
« Reply #5 on: April 16, 2009, 05:57:51 pm »
Code: [Select]
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

  • Guest
Re: !explode
« Reply #6 on: April 27, 2009, 04:09:09 pm »
Code: [Select]
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

  • Posts: 844
  • Turrets: +24/-24
Re: !explode
« Reply #7 on: April 28, 2009, 07:14:19 pm »
Code: [Select]
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

  • Guest
Re: !explode
« Reply #8 on: May 02, 2009, 09:33:40 am »
i know it is but............how the hell would anyone know how to patch it...????lol

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: !explode
« Reply #9 on: May 03, 2009, 12:03:51 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?