This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/vprogs/ents/triggers/trigger_secret.c

46 lines
675 B
C

/*
+==============+
|TRIGGER_SECRET|
+==============+
*/
void() trigger_secret_think =
{
total_secrets++;
if(pev->target)
IEM_usetarget();
};
void() trigger_secret_touch =
{
if(!(other.flags & FL_CLIENT))
return;
if(pev->touched == FALSE)
{
if (!pev->message)
pev->message = "You found a secret area!";
else
centerprint(other, pev->message);
if(pev->delay)
{
pev->think = trigger_secret_think;
pev->nextthink = time + pev->delay;
}
pev->touched = TRUE;
}
};
void() trigger_secret =
{
trigger_setup();
pev->touch = trigger_secret_touch;
if(!pev->delay)
pev->delay = 0.1;
};