Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.3 KiB

/***
*
* 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:
6 years ago
void Spawn();
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
};
6 years ago
LINK_ENTITY_TO_CLASS( trigger_command, CTriggerCommand )
6 years ago
void CTriggerCommand::Spawn()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
pev->effects = 0;
pev->frame = 0;
}
6 years ago
void CTriggerCommand::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
6 years ago
char cmd[64];
6 years ago
if( !pActivator || !pActivator->IsPlayer() )
return;
6 years ago
if( !pev->netname )
return;
6 years ago
sprintf( cmd, "%s\n", STRING( pev->netname ) );
CLIENT_COMMAND( ENT( pActivator->pev ), cmd );
6 years ago
UTIL_Remove( this );
}