55 lines
1.3 KiB
C++
Raw Normal View History

/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "customentity.h"
#include "effects.h"
#include "weapons.h"
class CTriggerCommand : public CPointEntity
{
public:
2018-07-10 03:47:18 +05:00
void Spawn();
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
};
2018-07-10 03:47:18 +05:00
LINK_ENTITY_TO_CLASS( trigger_command, CTriggerCommand )
2018-07-10 03:47:18 +05:00
void CTriggerCommand::Spawn()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
pev->effects = 0;
pev->frame = 0;
}
2018-07-10 03:47:18 +05:00
void CTriggerCommand::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
2018-07-10 03:47:18 +05:00
char cmd[64];
2018-07-10 03:47:18 +05:00
if( !pActivator || !pActivator->IsPlayer() )
return;
2018-07-10 03:47:18 +05:00
if( !pev->netname )
return;
2018-07-10 03:47:18 +05:00
sprintf( cmd, "%s\n", STRING( pev->netname ) );
CLIENT_COMMAND( ENT( pActivator->pev ), cmd );
2018-07-10 03:47:18 +05:00
UTIL_Remove( this );
}