Не. Ну вот как я с импульсом боролся:
//=========================================================
//=========================================================
void CBasePlayer::CheatImpulseCommands( int iImpulse )
{
#if !defined( HLDEMO_BUILD )
if ( g_flWeaponCheat == 0.0 )
{
return;
}
CBaseEntity *pEntity;
TraceResult tr;
switch ( iImpulse )
{
case 76:
{
if (!giPrecacheGrunt)
{
giPrecacheGrunt = 1;
ALERT(at_debug, "You must now restart to use Grunt-o-matic.\n");
}
else
{
UTIL_MakeVectors( Vector( 0, pev->v_angle.y, 0 ) );
Create("monster_human_grunt", pev->origin + gpGlobals->v_forward * 128, pev->angles);
}
break;
}
case 101:
gEvilImpulse101 = TRUE;
UTIL_CenterPrintAll( "Cheaters and emo must die!" );
gEvilImpulse101 = FALSE;
break;
case 111:
if (!giPrecacheHLweapons)
{
ALERT(at_console, "Now you should restart, and use impulse 111 again to get half-life weapons\n");
UTIL_CenterPrintAll( "Cheaters and emo must die!" );
giPrecacheHLweapons = 1;
break;
}
gEvilImpulse101 = TRUE;
#ifndef OEM_BUILD
UTIL_CenterPrintAll( "Cheaters and emo must die!" );
#endif
gEvilImpulse101 = FALSE;
break;
case 102:
// Gibbage!!!
CGib::SpawnRandomGibs( pev, 1, 1 );
break;
case 103:
// What the hell are you doing?
pEntity = FindEntityForward( this );
if ( pEntity )
{
CBaseMonster *pMonster = pEntity->MyMonsterPointer();
if ( pMonster )
pMonster->ReportAIState();
}
break;
case 104:
// Dump all of the global state varaibles (and global entity names)
gGlobalState.DumpGlobals();
break;
case 105:// player makes no sound for monsters to hear.
{
if ( m_fNoPlayerSound )
{
ALERT ( at_debug, "Player is audible\n" );
m_fNoPlayerSound = FALSE;
}
else
{
ALERT ( at_debug, "Player is silent\n" );
m_fNoPlayerSound = TRUE;
}
break;
}
case 106:
// Give me the classname and targetname of this entity.
pEntity = FindEntityForward( this );
if ( pEntity )
{
ALERT ( at_debug, "Classname: %s", STRING( pEntity->pev->classname ) );
Про год я предполагал, а импульс просто так показал... А вообще нужно химичить с флагом FL_GODMODE.
Поищите
// check for godmode or invincibility
if ( pev->flags & FL_GODMODE )
{
return 0;
}
там можно кое-что нахимичить вместа return 0; поставить нужное действие...
Добавлено 22-05-2008 в 14:36:
Аналогично с ноклипом
if (pev->movetype == MOVETYPE_NOCLIP)
/*действие*/;
А с cmd еще не разобралсо...
Добавлено 22-05-2008 в 14:42:
Ну насчет сравнения поступающих команд с клиента, я думаю замешана функция
void (*pfnClientPrintf) ( edict_t* pEdict, PRINT_TYPE ptype, const char *szMsg );
Добавлено 22-05-2008 в 15:09:
Ну что. такие пути решения проблем возможны? Там еще нашел функцию регистрации команд, приходящих с клиента, вроде...
вот что пишется в консоле в Adrenaline Gamer Mod (сетевой мод на HL), если пытаешься ввести sv_cheats 1 :
] sv_cheats 1
"sv_cheats" changed to "1"
Server enforces variables and "sv_cheats" needs to be the same during the game
(A) bl: <AG Mod> Warned for using variable sv_cheats with value 1.000000 (1 violation(s)
"sv_cheats" changed to "0"