//
// print the message
//
- if (IS_PLAYER(activator) && self.message != "")
+ if(self)
+ if(IS_PLAYER(activator) && self.message != "")
+ if(IS_REAL_CLIENT(activator))
{
- if(IS_REAL_CLIENT(activator))
- {
- centerprint (activator, self.message);
- if (self.noise == "")
- play2(activator, "misc/talk.wav");
- }
+ centerprint(activator, self.message);
+ if (self.noise == "")
+ play2(activator, "misc/talk.wav");
}
//
void multi_touch()
{
- if (!(self.spawnflags & 2))
- if (!other.iscreature)
+ if(!(self.spawnflags & 2))
+ if(!other.iscreature)
return;
if(self.team)
void counter_use()
{
- self.count = self.count - 1;
+ self.count -= 1;
if (self.count < 0)
return;
- if (self.count != 0)
+ if (self.count == 0)
{
- if (IS_PLAYER(activator)
- && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
- {
- if (self.count >= 4)
- centerprint (activator, "There are more to go...");
- else if (self.count == 3)
- centerprint (activator, "Only 3 more to go...");
- else if (self.count == 2)
- centerprint (activator, "Only 2 more to go...");
- else
- centerprint (activator, "Only 1 more to go...");
- }
- return;
- }
+ if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
+ Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COMPLETED);
- if (IS_PLAYER(activator)
- && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
- centerprint(activator, "Sequence completed!");
- self.enemy = activator;
- multi_trigger ();
+ self.enemy = activator;
+ multi_trigger ();
+ }
+ else
+ {
+ if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
+ if(self.count >= 4)
+ Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER);
+ else
+ Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, self.count);
+ }
}
void counter_reset()
if(pl.voicescript_index < vs.cnt)
i = pl.voicescript_index * 2;
else if(n > vs.cnt * 2)
- i = mod(pl.voicescript_index - vs.cnt, (n - vs.cnt * 2 - 1) / 2) * 2 + vs.cnt * 2 + 1;
+ i = ((pl.voicescript_index - vs.cnt) % ((n - vs.cnt * 2 - 1) / 2)) * 2 + vs.cnt * 2 + 1;
else
i = -1;
for(ear = magicears; ear; ear = ear.enemy)
{
msgout = trigger_magicear_processmessage(ear, source, teamsay, privatesay, msgin);
- if (!(ear.spawnflags & 64))
- if(magicear_matched)
- return msgout;
+ if(!(ear.spawnflags & 64))
+ if(magicear_matched)
+ return msgout;
msgin = msgout;
}
return msgin;