您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ trap_Args函数代码示例

51自学网 2021-06-03 08:57:25
  C++
这篇教程C++ trap_Args函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中trap_Args函数的典型用法代码示例。如果您正苦于以下问题:C++ trap_Args函数的具体用法?C++ trap_Args怎么用?C++ trap_Args使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了trap_Args函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CG_mvDelete_f

// Explicit server command to remove a view from the client's snapshotvoid CG_mvDelete_f(void){	if (cg.demoPlayback)	{		return;	}	else	{		int pID = -1;		if (trap_Argc() > 1)		{			char aName[64];			trap_Args(aName, sizeof(aName));			pID = CG_findClientNum(aName);		}		else		{			cg_window_t *w = cg.mvCurrentActive;			if (w != NULL)			{				pID = (w->mvInfo & MV_PID);			}		}		if (pID >= 0 && CG_mvMergedClientLocate(pID))		{			trap_SendClientCommand(va("mvdel %d/n", pID));		}	}}
开发者ID:Ododo,项目名称:etlegacy,代码行数:34,


示例2: CG_CenterEcho_f

/*===================CG_CenterEcho_f===================*/void CG_CenterEcho_f( int localPlayerNum ) {	char text[1024];	trap_Args( text, sizeof( text ) );	CG_ReplaceCharacter( text, '//', '/n' );	CG_CenterPrint( localPlayerNum, text, SCREEN_HEIGHT * 0.30, 0.5 );}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:14,


示例3: CG_DumpLocation_f

/*===================CG_DumpLocation_fDump a target_location definition to a file===================*/static void CG_DumpLocation_f( void ) {	char locfilename[MAX_QPATH];	char locname[MAX_STRING_CHARS];	char *extptr, *buffptr;	fileHandle_t f;	// Check for argument	if ( trap_Argc() < 2 ) {		CG_Printf( "Usage: dumploc <locationname>/n" );		return;	}	trap_Args( locname, sizeof( locname ) );	// Open locations file	Q_strncpyz( locfilename, cgs.mapname, sizeof( locfilename ) );	extptr = locfilename + strlen( locfilename ) - 4;	if ( extptr < locfilename || Q_stricmp( extptr, ".bsp" ) ) {		CG_Printf( "Unable to dump, unknown map name?/n" );		return;	}	Q_strncpyz( extptr, ".loc", 5 );	trap_FS_FOpenFile( locfilename, &f, FS_APPEND_SYNC );	if ( !f ) {		CG_Printf( "Failed to open '%s' for writing./n", locfilename );		return;	}	// Strip bad characters out	for ( buffptr = locname; *buffptr; buffptr++ )	{		if ( *buffptr == '/n' ) {			*buffptr = ' ';		} else if ( *buffptr == '"' ) {			*buffptr = '/'';		}	}	// Kill any trailing space as well	if ( *( buffptr - 1 ) == ' ' ) {		*( buffptr - 1 ) = 0;	}	// Build the entity definition	buffptr = va(   "{/n/"classname/" /"target_location/"/n/"origin/" /"%i %i %i/"/n/"message/" /"%s/"/n}/n/n",					(int) cg.snap->ps.origin[0], (int) cg.snap->ps.origin[1], (int) cg.snap->ps.origin[2], locname );	// And write out/acknowledge	trap_FS_Write( buffptr, strlen( buffptr ), f );	trap_FS_FCloseFile( f );	CG_Printf( "Entity dumped to '%s' (%i %i %i)./n", locfilename,			   (int) cg.snap->ps.origin[0], (int) cg.snap->ps.origin[1], (int) cg.snap->ps.origin[2] );}
开发者ID:chegestar,项目名称:omni-bot,代码行数:58,


示例4: CG_VoiceTellAttacker_f

static void CG_VoiceTellAttacker_f( void ) {	int		clientNum;	char	command[128];	char	message[128];	clientNum = CG_LastAttacker();	if ( clientNum == -1 ) {		return;	}	trap_Args( message, 128 );	Com_sprintf( command, 128, "vtell %i %s", clientNum, message );	trap_SendClientCommand( command );}
开发者ID:0culus,项目名称:ioq3,代码行数:14,


示例5: CG_TellTarget_f

static void CG_TellTarget_f( void ) {	int		clientNum;	char	command[128];	char	message[128];	clientNum = CG_CrosshairPlayer();	if ( clientNum == -1 ) {		return;	}	trap_Args( message, 128 );	Com_sprintf( command, 128, "tell %i %s", clientNum, message );	trap_SendClientCommand( command );}
开发者ID:0culus,项目名称:ioq3,代码行数:14,


示例6: CG_VoiceTellAttacker_f

static void CG_VoiceTellAttacker_f( int localPlayerNum ) {	int		playerNum;	char	command[128];	char	message[128];	playerNum = CG_LastAttacker( localPlayerNum );	if ( playerNum == -1 ) {		return;	}	trap_Args( message, 128 );	Com_sprintf( command, 128, "%s %i %s", Com_LocalPlayerCvarName( localPlayerNum, "vtell" ), playerNum, message );	trap_SendClientCommand( command );}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:14,


示例7: CG_TellTarget_f

static void CG_TellTarget_f( int localPlayerNum ) {	int		playerNum;	char	command[128];	char	message[128];	playerNum = CG_CrosshairPlayer( localPlayerNum );	if ( playerNum == -1 ) {		return;	}	trap_Args( message, 128 );	Com_sprintf( command, 128, "%s %i %s", Com_LocalPlayerCvarName( localPlayerNum, "tell" ), playerNum, message );	trap_SendClientCommand( command );}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:14,


示例8: CG_mvNew_f

// Explicit server command to add a view to the client's snapshotvoid CG_mvNew_f(void){    if(cg.demoPlayback || trap_Argc() < 2) return;    else {        int pID;        char aName[64];        trap_Args(aName, sizeof(aName));        pID = CG_findClientNum(aName);        if(pID >= 0 && !CG_mvMergedClientLocate(pID)) {            trap_SendClientCommand(va("mvadd %d/n", pID));        }    }}
开发者ID:GenaSG,项目名称:ET,代码行数:16,


示例9: CG_HelpCmd_f

static void CG_HelpCmd_f(void){    char buffer[MAX_BUFFERLEN];    if(trap_Argc()>1)    {        trap_Args(buffer,MAX_BUFFERLEN);        if(!Q_stricmp(buffer,"g_gametype"))        {            int i;            Com_Printf("GT# -> gametype:/n");            for(i=0; gameNames[i]!=NULL; i++)                Com_Printf("%3i -> %s/n",i,gameNames[i]);        }    }    else    {        Com_Printf("available help:/n");        Com_Printf(" g_gametype/n");    }}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:22,


示例10: CG_Drop_f

void CG_Drop_f( void ) {	char	command[ 128 ];	char	message[ 128 ];	gitem_t	*item;	int	j;	if ( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) {		return;	}	if ( cg.predictedPlayerState.stats[ STAT_HEALTH ] <= 0 ) {		CG_Printf( "You must be alive to use this command./n" );		return;	}	trap_Args( message, 128 );	item = BG_FindItem( message );	if ( !item ) {		CG_Printf( "unknown item: %s/n", message );		return;	}	if ( !cg_items[ item->giTag ].registered ) {		return;	}	j = item->giTag;	switch ( item->giType ) {	case IT_WEAPON:		if ( cgs.dmflags & 256 ) {			return;		}		if ( !( cg.snap->ps.stats[ STAT_WEAPONS ] & ( 1 << j ) ) ) {			CG_Printf( "Out of item: %s/n", message );			return;		}		if ( cg.snap->ps.weaponstate != WEAPON_READY ) {			return;		}		if ( j == cg.snap->ps.weapon ) {			return;		}		if ( j <= WP_MACHINEGUN || j == WP_GRAPPLING_HOOK ) {			CG_Printf( "Item is not dropable./n" );			return;		}	case IT_AMMO:		if ( cg.snap->ps.ammo[ j ] < 1 ) {			CG_Printf( "Out of item: %s/n", message );			return;		}		break;	case IT_POWERUP:		if ( cg.snap->ps.powerups[ j ] <= cg.time ) {			CG_Printf( "Out of item: %s/n", message );			return;		}		break;	case IT_HOLDABLE:		if ( j == HI_KAMIKAZE ) {			CG_Printf( "Item is not dropable./n" );			return;		}		if ( bg_itemlist[ cg.snap->ps.stats[ STAT_HOLDABLE_ITEM ] ].giTag != j ) {			CG_Printf( "Out of item: %s/n", message );			return;		}		break;	default:		CG_Printf( "Item is not dropable./n" );		return;	}	Com_sprintf( command, 128, "drop %s", message );	trap_SendClientCommand( command );}
开发者ID:xzero450,项目名称:revolution,代码行数:74,



注:本文中的trap_Args函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ trap_Argv函数代码示例
C++ trap_Argc函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。