mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-28 06:42:39 +00:00
SERVER: Add trigger_awardpoints trigger
This commit is contained in:
parent
7e9490fad7
commit
1205b94030
1 changed files with 36 additions and 0 deletions
|
@ -363,6 +363,42 @@ void() trigger_setfire =
|
|||
self.touch = trigger_setfire_touch;
|
||||
}
|
||||
|
||||
//
|
||||
// trigger_awardpoints
|
||||
// Awards touching client Score on contact.
|
||||
//
|
||||
#define SPAWNFLAG_TRIGGERSCORE_REQUIRESTAND 1
|
||||
#define SPAWNFLAG_TRIGGERSCORE_REQUIRECROUCH 2
|
||||
#define SPAWNFLAG_TRIGGERSCORE_REQUIREPRONE 4
|
||||
#define SPAWNFLAG_TRIGGERSCORE_APPLY2XPOINTS 8
|
||||
|
||||
void() trigger_awardpoints_touch =
|
||||
{
|
||||
if (other.classname != "player" || other.downed)
|
||||
return;
|
||||
|
||||
if (other.stance != PLAYER_STANCE_STAND && (self.spawnflags & SPAWNFLAG_TRIGGERSCORE_REQUIRESTAND))
|
||||
return;
|
||||
if (other.stance != PLAYER_STANCE_CROUCH && (self.spawnflags & SPAWNFLAG_TRIGGERSCORE_REQUIRECROUCH))
|
||||
return;
|
||||
if (other.stance != PLAYER_STANCE_PRONE && (self.spawnflags & SPAWNFLAG_TRIGGERSCORE_REQUIREPRONE))
|
||||
return;
|
||||
|
||||
addmoney(other, self.points, (self.spawnflags & SPAWNFLAG_TRIGGERSCORE_APPLY2XPOINTS));
|
||||
|
||||
if (self.aistatus != "")
|
||||
sound(self, 0, self.aistatus, 1, 1);
|
||||
}
|
||||
|
||||
void() trigger_awardpoints =
|
||||
{
|
||||
InitTrigger ();
|
||||
self.touch = trigger_awardpoints_touch;
|
||||
|
||||
if (self.aistatus != "")
|
||||
precache_sound(self.aistatus);
|
||||
}
|
||||
|
||||
//
|
||||
// Quake Triggers
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue