User:Toy Wylie/RLV Documentation/unsit

From Second Life Wiki
< User:Toy Wylie‎ | RLV Documentation
Revision as of 03:04, 12 July 2010 by Toy Wylie (talk | contribs) (first draft, source code untested)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


@unsit

Type

# General
  1. Restriction

Implemented

Implemented since RLV version 1.10

Usage

# @unsit=force
  1. @unsit=<y/n>

Purpose

# Forces the target to stand up immediately. This command is not really reliable, however, so don't use it from within traps to unsit the victim, but use llUnSit() instead.
  1. Prevents the target from standing up. The avatar can sit down on any object but not stand up again. This also blocks teleporting.


See Also

Example 1

<lsl>default

{

   state_entry()
   {
       // set sit position
       llSitTarget(<0,0,0.1>,ZERO_ROTATION);
       llOwnerSay("Sit down on this prim and touch it.");
   }
   touch_start(integer total_number)
   {
       llOwnerSay("@unsit=force");
       llOwnerSay("You have been forced to stand up.");
   }

}

</lsl>

Example 2

<lsl>default

{

   state_entry()
   {
       // set sit position
       llSitTarget(<0,0,0.1>,ZERO_ROTATION);
   }
   changed(integer change)
   {
       if(change & CHANGED_LINK)
       {
           key avatar=llAvatarOnSitTarget();
           if(avatar==llGetOwner())
           {
               llOwnerSay("@unsit=n");
               llOwnerSay("You are now trapped on this object. You will be released in 30 seconds.");
               llSetTimerEvent(30.0);
           }
           else if(avatar==NULL_KEY)
           {
               llOwnerSay("@clear");
               llSetTimerEvent(0.0);
           }
       }
   }
   timer()
   {
       llOwnerSay("@clear");
       llUnSit(llAvatarOnSitTarget());
       llOwnerSay("You have been released.");
       llSetTimerEvent(0.0);
   }

}

</lsl>