void BlackBox_Record( const char *type, const char *pFormat, ... ) { static ConVarRef blackbox( "blackbox" ); if ( IsX360() ) return; if ( !blackbox.IsValid() || !blackbox.GetBool() ) return; int type_num; for ( type_num = 0; type_num < blackboxrecorder->GetTypeCount(); type_num++ ) { if ( !V_strcasecmp( blackboxrecorder->GetTypeName( type_num ), type ) ) break; } if ( type_num >= blackboxrecorder->GetTypeCount() ) { Msg( "Invalid blackbox type: %s\n", type ); return; } char szMessage[1024]; va_list marker; va_start( marker, pFormat); Q_vsnprintf( szMessage, sizeof( szMessage ), pFormat, marker); va_end( marker ); //Msg( "Record: %s: %s\n", type, szMessage ); blackboxrecorder->Record( type_num, szMessage ); }
void sv_allow_point_command_changed( IConVar *pConVar, const char *pOldString, float flOldValue ) { ConVarRef var( pConVar ); if ( !var.IsValid() ) { return; } const char *pNewValue = var.GetString(); if ( V_strcasecmp ( pNewValue, "always" ) == 0 ) { sAllowPointCommand = eAllowAlways; } else if (!V_strcasecmp(pNewValue, "whitelist")) { sAllowPointCommand = eAllowWhitelist; } else { sAllowPointCommand = eAllowNever; } }
void sv_allow_point_servercommand_changed( IConVar *pConVar, const char *pOldString, float flOldValue ) { ConVarRef var( pConVar ); if ( !var.IsValid() ) { return; } const char *pNewValue = var.GetString(); if ( V_strcasecmp ( pNewValue, "always" ) == 0 ) { sAllowPointServerCommand = eAllowAlways; } #ifdef TF_DLL else if ( V_strcasecmp ( pNewValue, "official" ) == 0 ) { sAllowPointServerCommand = eAllowOfficial; } #endif // TF_DLL else { sAllowPointServerCommand = eAllowNever; } }
int GetMessageIndex(const char* name) { #ifdef USE_PROTOBUF return g_Cstrike15UsermessageHelpers.GetIndex(name); #else char sz_mname[256]; int sizereturn; int index = 0; while (servergamedll->GetUserMessageInfo(index, sz_mname, 255, sizereturn)) { if (V_strcasecmp(name, sz_mname) == 0) { return index; } index++; } return -1; #endif }