mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-22 20:01:34 +00:00
SERVER: Add trigger_stuffcmd
This commit is contained in:
parent
5c3f23dc47
commit
6df8c971e8
1 changed files with 26 additions and 0 deletions
|
@ -240,6 +240,32 @@ void() trigger_activator =
|
||||||
self.touch = trigger_activator_touch;
|
self.touch = trigger_activator_touch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SPAWNFLAG_TRIGGERCMD_NOPLAYER 1
|
||||||
|
#define SPAWNFLAG_TRIGGERCMD_NOSPEC 2
|
||||||
|
void() trigger_stuffcmd_touch =
|
||||||
|
{
|
||||||
|
// First, lets make sure this is a client
|
||||||
|
if (other.classname != "player" && other.classname != "spectator")
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Don't interact with players
|
||||||
|
if ((self.spawnflags & SPAWNFLAG_TRIGGERCMD_NOPLAYER) && other.classname == "player")
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Don't interact with spectators
|
||||||
|
if ((self.spawnflags & SPAWNFLAG_TRIGGERCMD_NOSPEC) && other.classname == "spectator")
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Run the command.
|
||||||
|
stuffcmd(other, strcat(self.message, "\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void() trigger_stuffcmd =
|
||||||
|
{
|
||||||
|
InitTrigger();
|
||||||
|
self.touch = trigger_stuffcmd_touch;
|
||||||
|
}
|
||||||
|
|
||||||
/* ===================
|
/* ===================
|
||||||
Custom Teddy Triggers
|
Custom Teddy Triggers
|
||||||
===================*/
|
===================*/
|
||||||
|
|
Loading…
Reference in a new issue