AvatarInSim

De DigiWiki.

Version du 11 mars 2012 à 05:33 par Djphil (discuter | contributions)
(diff) ← Version précédente | Voir la version courante (diff) | Version suivante → (diff)

The function below determines if the avatar of the key passed to it is in the same sim (as a main agent or child agent, so it will also return TRUE for adjacent sims to a degree) as the script calling it.

float InSim(key id)
{
     return (llGetObjectMass(id));
}

Example Function Usage:

float InSim(key id)
{
     return (llGetObjectMass(id));
}
 
default
{
     touch_start(integer t)
     {
          if (InSim(llDetectedKey(0)))
          {
               // AV In Same Sim
          }
          else
          {
               // AV Not In Same Sim
          }
     }
}

Example Non-Function Usage:

default
{
     touch_start(integer t)
     {
          if (llGetObjectMass(llDetectedKey(0)))
          {
               // AV In Same Sim
          }
          else
          {
               // AV Not In Same Sim
          }
     }
}
Outils personnels
donate
Google Ads