View previous topic :: View next topic |
Author |
Message |
rj
Joined: 03 Jul 2008 Posts: 5
|
Posted: Sun Feb 14, 2010 9:55 pm Post subject: getting centerprint to player when they aren't activator |
|
|
this should be really simple but i'm failing and wondered if anyone here could offer a tidbit of advice.
i want a centerprint message sequence to play to the player via various trigger_relays. the only problem is that it's activated by a bot triggering its own special entity, so messages won't display due to this section in SUB_UseTargets:
Code: |
if (activator.classname == "player" && self.message != "")
{
centerprint (activator, self.message);
if (!self.noise)
sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
}
|
i'm trying to modify it so regardless of the activator, the centerprint will always show to the player (or any player in the game, if it's a coop match)
any ideas?
thanks in advance  |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Mon Feb 15, 2010 12:53 am Post subject: |
|
|
Code: |
local entity ent;
if (self.message != "")
{
ent = find(world, classname, "player");
while (ent != world)
{
centerprint(ent, self.message);
if (!self.noise)
sound(ent, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
ent = find(ent, classname, "player");
}
}
|
_________________ F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe. |
|
Back to top |
|
 |
rj
Joined: 03 Jul 2008 Posts: 5
|
Posted: Mon Feb 15, 2010 7:26 pm Post subject: |
|
|
legend
i was barking up the wrong tree trying to use checkclient but that looks a lot cleaner. should be useful for displaying messages triggered by monsters too when they get killed by something other than the player
cheers  |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|