Aller au contenu

Photo

Every player in area?


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Buddywarrior

Buddywarrior
  • Members
  • 256 messages
I'm writing a script for a creature, when it's at 25% life, it does something to every player in the area. I'm stuck at looping through all players in just the area. Here is what I have so far. The logic looks right to me, the compiler thinks otherwise =) . Any suggestion on how to best effect only players in the area the creature is in are welcome!

object oArea;// Get the area of the script caller.oArea = GetArea(OBJECT_SELF);
object oPC = ExploreAreaForPlayer(oArea);while (GetIsObjectValid(oPC)){   ActionSpeakString("Only Players in area should see this.");}

Thanks!

#2
Failed.Bard

Failed.Bard
  • Members
  • 774 messages
Something like this:

object oArea = GetArea (OBJECT_SELF);
object oPC = GetFirstPC();
while (GetIsObjectValid (oPC))
{
   if (GetArea (oPC) == oArea)
     {
      // Do stuff.
     }
   oPC = GetNextPC();



#3
Buddywarrior

Buddywarrior
  • Members
  • 256 messages
Ahhh thank you kindly Bard!