bool CBaseMultiplayerPlayer::ClientCommand( const CCommand &args )
{
	const char *pcmd = args[0];

	if ( FStrEq( pcmd, "ignoremsg" ) )
	{
		m_iIgnoreGlobalChat = (m_iIgnoreGlobalChat + 1) % 3;
		switch( m_iIgnoreGlobalChat )
		{
		case CHAT_IGNORE_NONE:
			ClientPrint( this, HUD_PRINTTALK, "#Accept_All_Messages" );
			break;
		case CHAT_IGNORE_ALL:
			ClientPrint( this, HUD_PRINTTALK, "#Ignore_Broadcast_Messages" );
			break;
		case CHAT_IGNORE_TEAM:
			ClientPrint( this, HUD_PRINTTALK, "#Ignore_Broadcast_Team_Messages" );
			break;
		default:
			break;
		}
		return true;
	}

	return BaseClass::ClientCommand( args );
}
Esempio n. 2
0
void Command_SmoothWalk(char **Arg, int ArgCount)
{
	GetIRWProfileInt(NULL, "Smooth", "SmoothWalk", &SmoothWalk);

	if(ArgCount == 1)
		SmoothWalk = SmoothWalk ? FALSE : TRUE;

	if(ArgCount >= 2)
	{
		if(!strcmp(Arg[1], "on"))
			SmoothWalk = TRUE;
		else if(!strcmp(Arg[1], "off"))
			SmoothWalk = FALSE;
		else
		{
			ClientPrint("Usage: smoothwalk on/off");
			return;
		}
	}

	SetIRWProfileInt(NULL, "Smooth", "SmoothWalk", SmoothWalk);
	ClientPrint("SmoothWalk is now: %s", SmoothWalk == TRUE ? "on" : "off");

	return;
}
Esempio n. 3
0
//-----------------------------------------------------------------------------
// Purpose: Round timelimit has been hit
//-----------------------------------------------------------------------------
void CDiscArena::TimeOver( void )
{
	// Display the 10 second warning first
	if ( !m_bShownTimeWarning )
	{
		m_bShownTimeWarning = TRUE;

		for ( int i = 1; i <= gpGlobals->maxClients; i++ )
		{
			CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );

			if (pPlayer && (pPlayer->pev->groupinfo & pev->groupinfo) && pPlayer->m_bHasDisconnected != TRUE)
				ClientPrint( pPlayer->pev, HUD_PRINTCENTER, "#Time_Warning" );
		}

		pev->nextthink = gpGlobals->time + 10;
	}
	else
	{
		for ( int i = 1; i <= gpGlobals->maxClients; i++ )
		{
			CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );

			if (pPlayer && (pPlayer->pev->groupinfo & pev->groupinfo) && (pPlayer->m_bHasDisconnected != TRUE) )
				ClientPrint( pPlayer->pev, HUD_PRINTCENTER, "#Time_Over" );
		}

		// Increment both scores to force the game to end
		m_iTeamOneScore++;
		m_iTeamTwoScore++;

		BattleOver();
	}
}
Esempio n. 4
0
	// For CTs to defuse the c4
	void CPlantedC4::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
	{
		CCSPlayer *player = dynamic_cast< CCSPlayer* >( pActivator );

		if ( !player || player->GetTeamNumber() != TEAM_CT)
			return;

		if ( m_bStartDefuse )
		{
			m_fNextDefuse = gpGlobals->curtime + 0.5;
		}
		else
		{
			// freeze the player in place while diffusing
			player->SetMaxSpeed( 1 );

			// tell the bots someone has started defusing
			//g_pBotControl->OnEvent( EVENT_BOMB_DEFUSING, pActivator );

			int defuseTime;
			if ( player->HasDefuser() )
			{
				// Log this information
				//UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Begin_Bomb_Defuse_With_Kit\"\n", 
				//	STRING( player->pev->netname ),
				//	GETPLAYERUSERID( player->edict() ),
				//	GETPLAYERAUTHID( player->edict() ) );

				ClientPrint( player, HUD_PRINTCENTER, "#Defusing_Bomb_With_Defuse_Kit" );
				defuseTime = 5;
			}
			else
			{
				// Log this information
				//UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Begin_Bomb_Defuse_Without_Kit\"\n", 
				//	STRING( player->pev->netname ),
				//	GETPLAYERUSERID( player->edict() ),
				//	GETPLAYERAUTHID( player->edict() ) );

				ClientPrint( player, HUD_PRINTCENTER, "#Defusing_Bomb_Without_Defuse_Kit" );
				defuseTime = 10;
			}

			CPASAttenuationFilter filter( player );
			EmitSound( filter, entindex(), "c4.disarm" );

			m_fNextDefuse = gpGlobals->curtime + 0.5;
			m_pBombDefuser = player;
			m_bStartDefuse = TRUE;
			player->m_bIsDefusing = true;

			m_flDefuseCountDown = gpGlobals->curtime + defuseTime;
			
			//start the progress bar
			player->SetProgressBarTime( defuseTime );
		}
	}
Esempio n. 5
0
// Attempt to change the observer mode
void CBasePlayer::Observer_SetMode( int iMode )
{

	// Just abort if we're changing to the mode we're already in
	if ( iMode == pev->iuser1 )
		return;

	// is valid mode ?
	if ( iMode < OBS_CHASE_LOCKED || iMode > OBS_MAP_CHASE )
		iMode = OBS_IN_EYE; // now it is
	// verify observer target again
	if ( m_hObserverTarget != NULL)
	{
		CBaseEntity *pEnt = m_hObserverTarget;

		if ( (pEnt == this) || (pEnt == NULL) )
			m_hObserverTarget = NULL;
		else if ( ((CBasePlayer*)pEnt)->IsObserver() || (pEnt->pev->effects & EF_NODRAW) )
			m_hObserverTarget = NULL;
	}

	// set spectator mode
	pev->iuser1 = iMode;

	// if we are not roaming, we need a valid target to track
	if ( (iMode != OBS_ROAMING) && (m_hObserverTarget == NULL) )
	{
		Observer_FindNextPlayer( false );

		// if we didn't find a valid target switch to roaming
		if (m_hObserverTarget == NULL)
		{
			ClientPrint( pev, HUD_PRINTCENTER, "#Spec_NoTarget"  );
			pev->iuser1 = OBS_ROAMING;
		}
	}

	// set target if not roaming
	if (pev->iuser1 == OBS_ROAMING)
	{
		pev->iuser2 = 0;
	}
	else
		pev->iuser2 = ENTINDEX( m_hObserverTarget->edict() );
	
	pev->iuser3 = 0;	// clear second target from death cam
	
	// print spepctaor mode on client screen

	char modemsg[16];
	sprintf(modemsg,"#Spec_Mode%i", pev->iuser1 );
	ClientPrint( pev, HUD_PRINTCENTER, modemsg );

	m_iObserverLastMode = iMode;
}
Esempio n. 6
0
void IRWCmd_JournalDump(char **Arg, int ArgCount)
{ 
	if(ArgCount < 2)
	{ 
		ClientPrint("Usage: journaldump [filename]"); 
		return; 
	} 

	JournalDump(Arg[1]); 
	ClientPrint("Dumped to your IRW directory"); 
	return;
}
Esempio n. 7
0
int DotaObjective::OnTakeDamage( const CTakeDamageInfo &inputInfo )
{
	if ( m_bMet )
		return 0;	

	if ( !(inputInfo.GetDamageType() & DMG_BULLET) )
	{
		CHL2MP_Player * playerAttacker = ToHL2MPPlayer( inputInfo.GetAttacker() );

		CreepMaker * maker = (CreepMaker*)gEntList.FindEntityByName( NULL, m_creepMakerName );
		if ( !maker )
			AssertMsg( false, "Objective can't find its creepmaker!\n" );
		
		CAI_BaseNPC * guardian = (CAI_BaseNPC*)gEntList.FindEntityByName( NULL, m_guardianName );	
		if( guardian && guardian->IsAlive() )
		{
			if( playerAttacker )
				ClientPrint( playerAttacker, HUD_PRINTTALK, UTIL_VarArgs("The guradian is alive in this lane, you can't hurt the gate.\n") );
		}
		else
		{
			m_timesHit++;
			m_timesHit = min(m_timesHit, OBJECTIVE_HEALTHI); // make sure times hit never goes above the maximum times an objective can be hit!

			CRecipientFilter user;
			user.AddRecipientsByTeam( this->GetTeam() );
			user.MakeReliable();
			char szText[200];
			Q_snprintf( szText, sizeof(szText), "Your ally gate is under attack from an enemy!" );
			UTIL_ClientPrintFilter( user, HUD_PRINTCENTER, szText );
			
			if( playerAttacker )
				ClientPrint( playerAttacker, HUD_PRINTTALK, UTIL_VarArgs("Gate has %i health left.\n", OBJECTIVE_HEALTHI - m_timesHit) );

			if (m_timesHit >= OBJECTIVE_HEALTHI)
			{
				TakeAction(DOBJ_ACTION_CLOSE);
			} else {
				IGameEvent *pEvent = gameeventmanager->CreateEvent( "objectivegate_attacked" );

				if ( pEvent )
				{
					pEvent->SetString( "lane", GetLane() );
					pEvent->SetInt( "team", this->GetTeamNumber() );
					pEvent->SetFloat( "health", (OBJECTIVE_HEALTHF - m_timesHit)/OBJECTIVE_HEALTHF );
					gameeventmanager->FireEvent( pEvent );
				}
			}
		}
	}

	return 0;
}
Esempio n. 8
0
void Target_Info(unsigned int Serial, unsigned short X, unsigned short Y, int Z)
{
	GameObject Obj;

	if(Serial == INVALID_SERIAL)
	{
		ClientPrint("Invalid target");
		return;
	}

	if(GetObjectInfo(Serial, INVALID_IDX, &Obj) == OBJECT_NOTFOUND)
	{
		ClientPrint("Object not in the world list");
		return;
	}

	ClientPrint("Serial 0x%08X", Obj.Serial);
	ClientPrint("Graphic: 0x%04X Color: 0x%04X", Obj.Graphic, Obj.Color);
	ClientPrint("Container: 0x%08X Quantity: %d", Obj.Container, Obj.Quantity);
	
	/* if the object wasn't a character, GetObjectInfo frees the pointer */
	if(Obj.Character == NULL) return;
	
	/* if it's a character display the info */
	ClientPrint("Name %s", Obj.Character->Name);
	ClientPrint("HP: %d MaxHP: %d", Obj.Character->HitPoints, Obj.Character->MaxHitPoints);
	ClientPrint("Current HP: %d%%", (Obj.Character->HitPoints*100)/Obj.Character->MaxHitPoints);

	FREECHAR(Obj);
	return;
}
Esempio n. 9
0
void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
	if (!m_bIsC4)
		return;

	CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pActivator->pev);

	if (pPlayer->m_iTeam != TEAM_CT)
		return;

	if (m_bStartDefuse)
	{
		m_fNextDefuse = gpGlobals->time + 0.5;
		return;
	}

	g_engfuncs.pfnSetClientMaxspeed(pPlayer->edict(), 1);

	if (g_pGameRules->IsCareer())
	{
	}

	if (pPlayer->m_bHasDefuser == true)
	{
		UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Begin_Bomb_Defuse_With_Kit\"\n", STRING(pPlayer->pev->netname), GETPLAYERUSERID(pPlayer->edict()), GETPLAYERAUTHID(pPlayer->edict()));
		ClientPrint(pPlayer->pev, HUD_PRINTCENTER, "#Defusing_Bomb_With_Defuse_Kit");
		EMIT_SOUND(ENT(pPlayer->pev), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM);

		pPlayer->m_bIsDefusing = true;
		m_pBombDefuser = pCaller;
		m_bStartDefuse = true;
		m_flDefuseCountDown = gpGlobals->time + 5;
		m_fNextDefuse = gpGlobals->time + 0.5;
		pPlayer->SetProgressBarTime(5);
	}
	else
	{
		UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Begin_Bomb_Defuse_Without_Kit\"\n", STRING(pPlayer->pev->netname), GETPLAYERUSERID(pPlayer->edict()), GETPLAYERAUTHID(pPlayer->edict()));
		ClientPrint(pPlayer->pev, HUD_PRINTCENTER, "#Defusing_Bomb_Without_Defuse_Kit");
		EMIT_SOUND(ENT(pPlayer->pev), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM);

		pPlayer->m_bIsDefusing = true;
		m_pBombDefuser = pCaller;
		m_bStartDefuse = true;
		m_flDefuseCountDown = gpGlobals->time + 10;
		m_fNextDefuse = gpGlobals->time + 0.5;
		pPlayer->SetProgressBarTime(10);
	}
}
Esempio n. 10
0
void CFamas::SecondaryAttack()
{
    if( FBitSet( m_fWeaponState, WEAPONSTATE_FAMAS_BURST_MODE ) )
    {
        ClientPrint( m_pPlayer->pev, HUD_PRINTCENTER, "#Switch_To_FullAuto" );
        ClearBits( m_fWeaponState, WEAPONSTATE_FAMAS_BURST_MODE );
    }
    else
    {
        ClientPrint( m_pPlayer->pev, HUD_PRINTCENTER, "#Switch_To_BurstFire" );
        SetBits( m_fWeaponState, WEAPONSTATE_FAMAS_BURST_MODE );
    }

    m_flNextSecondaryAttack = gpGlobals->time + 0.3;
}
Esempio n. 11
0
void CFamas::__MAKE_VHOOK(SecondaryAttack)()
{
	if (m_iWeaponState & WPNSTATE_FAMAS_BURST_MODE)
	{
		ClientPrint(m_pPlayer->pev, HUD_PRINTCENTER, "#Switch_To_FullAuto");
		m_iWeaponState &= ~WPNSTATE_FAMAS_BURST_MODE;
	}
	else
	{
		ClientPrint(m_pPlayer->pev, HUD_PRINTCENTER, "#Switch_To_BurstFire");
		m_iWeaponState |= WPNSTATE_FAMAS_BURST_MODE;
	}

	m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3f;
}
Esempio n. 12
0
void IRWCmd_IsInJournal(char **Arg, int ArgCount)
{
	if(ArgCount < 2)
	{
		ClientPrint("Usage: isinjournal text");
		return;
	}

	if(IsInJournal(Arg[1], JOURNAL_ANY) != -1)
		ClientPrint("Oh.. yes. It is in journal.. so what?");
	else
		ClientPrint("Sorry its not in journal ;("); 

	return;
}
Esempio n. 13
0
void ParaEnable( edict_t *pEntity )
{
	
	if (ChuteState[ ENTINDEX( pEntity ) ] != 1) {
		ClientPrint( VARS(pEntity), HUD_PRINTTALK, "* You don't have a parachute! Go pick one up!\n");
		return;
	}
	// cant use the parachute when you are on the ground

	if (pEntity->v.flags & FL_ONGROUND) {
		ClientPrint( VARS(pEntity), HUD_PRINTTALK, "* Parachutes only work in the air!\n");
		return;
	}
	
	// turns on the parachute
	ChuteState[ ENTINDEX( pEntity ) ] = 2;
	entvars_t *pev = VARS( pEntity );

	// set initial vars
	pev->gravity = 0.1;
	pev->speed = 0;
	pev->velocity = g_vecZero;

	// give them the parachute model

	int i = 1;
	edict_t *frontEnt;
	entvars_t *pModelPev;

	int mdlfound = 0;

	for (i; i < 1025; i++) {

		frontEnt = INDEXENT ( i );
		if (frontEnt) {
			pModelPev =  VARS(frontEnt);
			if (FStrEq((char *)STRING(pModelPev->netname), "para")) {
				// Touch this ent.
				(*other_gFunctionTable.pfnTouch)(frontEnt, pEntity);
			}
		}
	}

	// The parachute has been given to em
	// Now, we just wait for em to hit the ground then we take the chute again


}
Esempio n. 14
0
BOOL CItemThighPack::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
{
	if (pPlayer->m_iTeam != CT || pPlayer->m_bHasDefuser)
		return FALSE;

	pPlayer->m_bHasDefuser = true;
	pPlayer->pev->body = 1;

	ClientPrint(pPlayer->pev, HUD_PRINTCENTER, "#Got_defuser");

	MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, pPlayer->pev);
		WRITE_BYTE(STATUSICON_SHOW);
		WRITE_STRING("defuser");
		WRITE_BYTE(0);
		WRITE_BYTE(160);
		WRITE_BYTE(0);
	MESSAGE_END();

	pPlayer->SendItemStatus();
	EMIT_SOUND(pPlayer->edict(), CHAN_VOICE, "items/kevlar.wav", VOL_NORM, ATTN_NORM);

	if (TheTutor != NULL)
	{
		TheTutor->OnEvent(EVENT_PLAYER_BOUGHT_SOMETHING, pPlayer);
	}

	return TRUE;
}
Esempio n. 15
0
void Command_TileInfo(char **Arg, int ArgCount)
{
	ClientPrint("Choose a spot on the ground");
	RequestTarget(TARGET_TILE, &Target_TileInfo);

	return;
}
Esempio n. 16
0
void Command_Info(char **Arg, int ArgCount)
{
	ClientPrint("Choose your target");
	RequestTarget(TARGET_OBJECT, &Target_Info);

	return;
}
void CHealthRechargerClassic::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
    if (!pActivator || !pActivator->IsPlayer())
    {
        return;
    }
    else if (GameRules()->GetGameMode() == GAMEMODE_CLASSIC)
    {
        if (ClassicGameRules()->GetCurrentPhaseID() == PHASE_BUILD)
        {
            if (m_flSoundTime <= gpGlobals->curtime)
            {
                m_flSoundTime = gpGlobals->curtime + 0.62;
                EmitSound( "WallHealth.Deny" );
            }
            return;
        }
        else if (GetTeamNumber() != pActivator->GetTeamNumber() &&
                 GetTeamNumber() != TEAM_SPECTATOR)
        {
            if (m_flSoundTime <= gpGlobals->curtime)
            {
                CBasePlayer *pPlayer = ToBasePlayer( pActivator );
                Assert( pPlayer );
                ClientPrint( pPlayer, HUD_PRINTTALK, "#lf_health_charger_deny" );

                m_flSoundTime = gpGlobals->curtime + 0.62;
                EmitSound( "WallHealth.Deny" );
            }
            return;
        }
    }

    BaseClass::Use( pActivator, pCaller, useType, value );
}
Esempio n. 18
0
void CC4::OnPickedUp( CBaseCombatCharacter *pNewOwner )
{
	BaseClass::OnPickedUp( pNewOwner );

#if !defined( CLIENT_DLL )
	CCSPlayer *pPlayer = dynamic_cast<CCSPlayer *>( pNewOwner );

	IGameEvent * event = gameeventmanager->CreateEvent( "bomb_pickup" );
	if ( event )
	{
		event->SetInt( "userid", pPlayer->GetUserID() );
		event->SetInt( "priority", 6 );
		gameeventmanager->FireEvent( event );
	}

	if ( pPlayer->m_bShowHints && !(pPlayer->m_iDisplayHistoryBits & DHF_BOMB_RETRIEVED) )
	{
		pPlayer->m_iDisplayHistoryBits |= DHF_BOMB_RETRIEVED;
		pPlayer->HintMessage( "#Hint_you_have_the_bomb", false );
	}
	else
	{
		ClientPrint( pPlayer, HUD_PRINTCENTER, "#Got_bomb" );
	}
#endif
}
Esempio n. 19
0
void AvHBasePlayerWeapon::PrintWeaponToClient(CBaseEntity *theAvHPlayer) {
	char msg[1024];
	ItemInfo theItemInfo;
	this->GetItemInfo(&theItemInfo);
	sprintf(msg, "%s iuser3=%d\tenabled = %d\n", theItemInfo.pszName, this->pev->iuser3, this->m_iEnabled);
	ClientPrint(theAvHPlayer->pev, HUD_PRINTNOTIFY, msg);
}
Esempio n. 20
0
// Secondary attack could be three-round burst mode
void CWeaponFamas::SecondaryAttack()
{
    CMomentumPlayer *pPlayer = GetPlayerOwner();
    if (!pPlayer)
        return;

    if (m_bBurstMode)
    {
        ClientPrint(pPlayer, HUD_PRINTCENTER, "#Switch_To_FullAuto");
        m_bBurstMode = false;
    }
    else
    {
        ClientPrint(pPlayer, HUD_PRINTCENTER, "#Switch_To_BurstFire");
        m_bBurstMode = true;
    }
    m_flNextSecondaryAttack = gpGlobals->curtime + 0.3;
}
Esempio n. 21
0
void CKickIssue::ListIssueDetails(CBasePlayer *a2)
{
	char s[64];
	if (true)//There should be check or something
	{
		V_snprintf(s, sizeof(s), "callvote %s <userID>\n", GetTypeString());
		ClientPrint(a2, 2, s);
	}
}
Esempio n. 22
0
int CAK74::AddToPlayer( CBasePlayer *pPlayer )
{
	if ( CBasePlayerWeapon::AddToPlayer( pPlayer ) )
	{
		ClientPrint(m_pPlayer->pev, HUD_PRINTCENTER, "#Pickup_Ak47"); //digamos al cliente
		return TRUE;
	}
	return FALSE;
}
Esempio n. 23
0
void ParaTouch( edict_t *pent, edict_t *pEntity )
{
	// Called when someone touches the parachute on the ground
	// Remote it, give them a chute, and make it respawn in 20 seconds.

	if (!FStrEq((char*)STRING(pEntity->v.classname), "player")) return;


	#ifdef DEBUGLOG 
	fp=fopen("para.txt","a");
	fprintf(fp, "Starting Para Touch\n");
	fclose(fp);	
	#endif	

	// check if he already has a chute
	if ( ChuteState[ ENTINDEX( pEntity ) ] != 0 ) return;

	// give the player the chute
	ParaGiveChute( pEntity );


	// make a sound that sounds like you are getting a chute
	// use TFC r_item1 sound... its pretty good

	EMIT_SOUND_DYN2( pent, CHAN_VOICE, "items/r_item1.wav", 1.0, ATTN_NORM, 0, 100 );
	
	// respawn in 20 seconds

	pent->v.nextthink = gpGlobals->time + 20;

	// hide the chute from being seen
	pent->v.solid = SOLID_NOT;
	pent->v.effects |= EF_NODRAW;

	// Put the little long jump icon in the client's HUD

	// register the message that tells clients we picked up an item, so that we can USE this message.
	// if we dont register it, the client doesnt know what we are talking about

	//	if (gmsgItemPickup == 0) gmsgItemPickup = REG_USER_MSG( "ItemPickup", -1 );
	
	#ifdef DEBUGLOG 
	fp=fopen("para.txt","a");
	fprintf(fp, "It appears to be %i\n", gmsgItemPickup);
	fclose(fp);	
	#endif	

	MESSAGE_BEGIN( MSG_ONE, gmsgItemPickup, NULL, pEntity );
		WRITE_STRING( "item_longjump" );
	MESSAGE_END();

	ClientPrint( VARS(pEntity), HUD_PRINTTALK, "* You've picked up a parachute! Bind 'deploypara' to use it!\n");



}
Esempio n. 24
0
//-----------------------------------------------------------------------------
// Purpose: Toggles between pull and rappel mode
//-----------------------------------------------------------------------------
bool CWeaponGrapple::ToggleHook(void)
{
#ifndef CLIENT_DLL
	CBasePlayer *pPlayer = ToBasePlayer(GetOwner());
	if (m_bHook)
	{
		m_bHook = false;
		ClientPrint(pPlayer, HUD_PRINTCENTER, "Pull mode");
		return m_bHook;
	}
	else
	{
		m_bHook = true;
		ClientPrint(pPlayer, HUD_PRINTCENTER, "Rappel mode");
		return m_bHook;
	}
#endif
	return m_bHook;
}
//-----------------------------------------------------------------------------
// Purpose: Can we get into the vehicle?
//-----------------------------------------------------------------------------
bool CObjectBaseMannedGun::CanGetInVehicle( CBaseTFPlayer *pPlayer )
{
	if ( !IsPowered() )
	{
		ClientPrint( pPlayer, HUD_PRINTCENTER, "No power source for the manned gun!" );
		return false;
	}

	return true;
}
Esempio n. 26
0
void Target_TileInfo(unsigned int Serial, unsigned short X, unsigned short Y, int Z)
{
	GameObject Obj;

	if(Serial == INVALID_SERIAL)
		ClientPrint("X: %d Y: %d Z: %d", X, Y, Z);
	else
	{
		if(GetObjectInfo(Serial, INVALID_IDX, &Obj) == OBJECT_NOTFOUND)
		{
			ClientPrintWarning("The targeted object does not exist in the world list... wtf");
			return;
		}

		ClientPrint("You targeted an object, serial: 0x%08X", Serial);
		ClientPrint("Position: X: %d Y: %d Z: %d", Obj.X, Obj.Y, Obj.Z);
	}

	return;
}
//------------------------------------------------------------------------------
// Applies keyvalues to the entity by hammer ID.
//------------------------------------------------------------------------------
void CC_Ent_Keyvalue( const CCommand &args )
{
	// Must have an odd number of arguments.
	if ( ( args.ArgC() < 4 ) || ( args.ArgC() & 1 ) )
	{
		Msg( "Format: ent_keyvalue <entity id> \"key1\" \"value1\" \"key2\" \"value2\" ... \"keyN\" \"valueN\"\n" );
		return;
	}

	CBasePlayer *pPlayer = ToBasePlayer( UTIL_GetCommandClient() );
	CBaseEntity *pEnt;
	if ( FStrEq( args[1], "" ) || FStrEq( args[1], "!picker" ) )
	{
		if (!pPlayer)
			return;

		extern CBaseEntity *FindPickerEntity( CBasePlayer *pPlayer );
		pEnt = FindPickerEntity( pPlayer );

		if ( !pEnt )
		{
			ClientPrint( pPlayer, HUD_PRINTCONSOLE, "No entity in front of player.\n" );
			return;
		}
	}
	else if ( FStrEq( args[1], "!self" ) || FStrEq( args[1], "!caller" ) || FStrEq( args[1], "!activator" ) )
	{
		if (!pPlayer)
			return;

		pEnt = pPlayer;
	}
	else
	{
		int nID = atoi( args[1] );

		pEnt = g_ServerTools.FindEntityByHammerID( nID );
		if ( !pEnt )
		{
			Msg( "Entity ID %d not found.\n", nID );
			return;
		}
	}

	int nArg = 2;
	while ( nArg < args.ArgC() )
	{
		const char *pszKey = args[ nArg ];
		const char *pszValue = args[ nArg + 1 ];
		nArg += 2;

		g_ServerTools.SetKeyValue( pEnt, pszKey, pszValue );
	}
} 
Esempio n. 28
0
void Command_Resync(char **Arg, int ArgCount)
{
	unsigned char ResyncReq[3]= { 0x22, 0x00, 0x00 };
	
	if(!GetPlayerSerial()) return;
	
	ClientPrint("Sending resync request..");
	SendToServer(ResyncReq, 3);     

	return;
}
Esempio n. 29
0
void Command_Action(char **Arg, int ArgCount)
{
	char BowPkt[8] = { 0x12, 0x00, 0x08, 0xC7, 'b', 'o', 'w', '\0' };
	char SalutePkt[11] = { 0x12, 0x00, 0x0B, 0xC7, 's', 'a', 'l', 'u', 't', 'e', '\0' };
	int PktLen = 0;

	if(ArgCount < 2)
	{
		ClientPrint("Usage: action [type]");
		ClientPrint("[type] being: bow salute");
		return;
	}

	if(!stricmp(Arg[1], "bow"))
		SendToServer(BowPkt, 8);
	else if(!stricmp(Arg[1], "salute"))
		SendToServer(SalutePkt, 11);
	else
		ClientPrint("Unknown action: %s", Arg[1]);
    
	return;
}
Esempio n. 30
0
int CMP5::AddToPlayer( CBasePlayer *pPlayer )
{
	if ( CBasePlayerWeapon::AddToPlayer( pPlayer ) )
	{
				ClientPrint(m_pPlayer->pev, HUD_PRINTCENTER, "#Pickup_MP5"); //digamos al cliente

		MESSAGE_BEGIN( MSG_ONE, gmsgWeapPickup, NULL, pPlayer->pev );
			WRITE_BYTE( m_iId );
		MESSAGE_END();
		return TRUE;
	}
	return FALSE;
}