Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USE key code
#6
Quote:void ClientCommand( edict_t *pEntity )
{
const char *pcmd = CMD_ARGV(0);
const char *pstr;

// Is the client spawned yet?
if ( !pEntity->pvPrivateData )
  return;

entvars_t *pev = &pEntity->v;

if ( FStrEq(pcmd, "say" ) )
{
  Host_Say( pEntity, 0 );
}
else if ( FStrEq(pcmd, "say_team" ) )
{
  Host_Say( pEntity, 1 );
}
else if ( FStrEq(pcmd, "spectate" ) )
{
  // Prevent this is the cvar is set
  if ( allow_spectators.value )
  {
   CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pev);
   edict_t *pentSpawnSpot = EntSelectSpawnPoint( pPlayer );
   pPlayer->StartObserver( VARS(pentSpawnSpot)->origin, VARS(pentSpawnSpot)->angles);
  }
}

else if ( FStrEq(pcmd, "ob_mode" ) )
{
  CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pev);
  pPlayer->ObserverInput_ChangeMode();
}
else if ( FStrEq(pcmd, "ob_prev" ) )
{
  CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pev);
  pPlayer->ObserverInput_PrevPlayer();
}
else if ( FStrEq(pcmd, "ob_next" ) )
{
  CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pev);
  pPlayer->ObserverInput_NextPlayer();
}

else if ( FStrEq(pcmd, "give" ) )
{
  if ( g_flWeaponCheat != 0.0)
  {
   int iszItem = ALLOC_STRING( CMD_ARGV(1) ); // Make a copy of the classname
   GetClassPtr((CBasePlayer *)pev)->GiveNamedItem( STRING(iszItem) );
  }
}

else if ( FStrEq(pcmd, "drop" ) )
{
  // player is dropping an item.
  GetClassPtr((CBasePlayer *)pev)->DropPlayerItem((char *)CMD_ARGV(1));
}
else if ( FStrEq(pcmd, "fov" ) )
{
  if ( g_flWeaponCheat && CMD_ARGC() > 1)
  {
   GetClassPtr((CBasePlayer *)pev)->m_iFOV = atoi( CMD_ARGV(1) );
  }
  else
  {
   CLIENT_PRINTF( pEntity, print_console, UTIL_VarArgs( "\"fov\" is \"%d\"\n", (int)GetClassPtr((CBasePlayer *)pev)->m_iFOV ) );
  }
}
else if ( FStrEq(pcmd, "use" ) )
{
  GetClassPtr((CBasePlayer *)pev)->SelectItem((char *)CMD_ARGV(1));
}

The client is obviously issuing that command. Therefore, wtf is behind CMD_ARGV(1) ? Not sure ... but it's got to be a bad pointer of some sort. Thinking about the multiplayer game, when you are in the Towers using the guns on rc_crossfire, you aren't allowed to move, so maybe what it does is set your body mass to some high figure so you don't actually move if hit.
Reply


Messages In This Thread
USE key code - by evil_admin - 07-28-2003, 08:20 PM
USE key code - by Guest - 07-29-2003, 02:32 AM
USE key code - by kermit - 07-29-2003, 06:48 AM
USE key code - by Guest - 07-29-2003, 01:24 PM
USE key code - by GRITS - 07-29-2003, 02:14 PM
USE key code - by Guest - 07-29-2003, 04:09 PM
USE key code - by Guest - 07-29-2003, 04:16 PM
USE key code - by Pique - 08-03-2003, 12:43 PM
USE key code - by evil_admin - 08-03-2003, 01:37 PM
USE key code - by Guest - 08-03-2003, 02:47 PM
USE key code - by kermit - 08-08-2003, 07:57 PM
USE key code - by evil_admin - 08-09-2003, 10:07 AM
USE key code - by evil_admin - 08-09-2003, 01:40 PM
USE key code - by kermit - 08-09-2003, 06:04 PM
USE key code - by evil_admin - 08-09-2003, 06:43 PM
USE key code - by kermit - 08-09-2003, 06:50 PM
USE key code - by evil_admin - 08-09-2003, 10:04 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)