Lot Reservation

From Second Life Wiki
Revision as of 22:11, 17 March 2009 by BETLOG Hax (talk | contribs) (New page: ==Lot Reservation v1.0.0== Click an object to reserve a lot/parcel. <br> Very simple means of reserving a place. <br> The person who reserved the lot can reset/relinquish their reservation...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Lot Reservation v1.0.0

Click an object to reserve a lot/parcel.
Very simple means of reserving a place.
The person who reserved the lot can reset/relinquish their reservation by touching the prim again.
The owner of the prim can reset anyone's reservation.
No attempt is made to make sure people don't reserve more than one (as that may be your requirement).
Originally written for Moxie Polano and RFL lot reservation in Haute Couture sim.
TO USE: Drop into a prim, scale and position prim on a map of the area to be shared. Persons wishing to reserve a place click on the prim.

<lsl> //========================================================================= // LICENCE: // Creative Commons Attribution-Share Alike 3.0 license // http://creativecommons.org/licenses/by-sa/3.0/ // You can modify this script, but you must prominently state that you // used this script, credit it's original author(s), and supply this // unaltered script with your modification. // // If you significantly rework my script: // I suggest that you include a full permissions notecard in your object called // 'CREDITS', into which you drag the original/unaltered version of this script. // OR // If you use my original script unaltered: (or just edit a few of my global variables) // Simply use my original script as-is: with the same (full) permissions, // and in the original script that lists BETLOG Hax as it's creator. // Either of these two options gives 'attribution' and complies with this licence. //========================================================================= // SHARED CONFIGURATION integer gPayloadPIN = -81520; //---------------------------------- // CONFIGURATION vector gReservedColor = <1.0, 0.0, 0.0>; vector gVacantColor = <0.0, 1.0, 0.0>; //---------------------------------- // CORE CODE string gReservedName; key gReservedKey; //========================================================================= default { on_rez(integer start_param)

   {   llResetScript();
   }
   state_entry()
   {   if (gPayloadPIN)    llSetRemoteScriptAccessPin(gPayloadPIN);
       llSetText("vacant", gVacantColor, 1.0);
       llSetColor(gVacantColor, ALL_SIDES);
   }
   touch_start(integer total_number)
   {   gReservedName = llDetectedName(0);
       gReservedKey = llDetectedKey(0);
       llSetText(gReservedName, gReservedColor, 1.0);        
       llSetColor(gReservedColor, ALL_SIDES);        
       llInstantMessage(gReservedKey, 
           "Thanks "+gReservedName+", this lot is now reserved for you."
           +"\nIf you wish to relinquish this one for another lot, then touch this object again and this lot will become available."
           +"\nPlease only reserve one lot."            
       );
       state reserved;
   }

} //======================================================================== state reserved { on_rez(integer start_param)

   {   llResetScript();
   }
   state_entry()
   {
   }
   touch_start(integer total_number)
   {   key uuid = llDetectedKey(0);
       if (uuid == llGetOwner() || uuid == gReservedKey)
       {   llInstantMessage(gReservedKey, 
               "Thanks "+gReservedName+", you have now released this lot."
               +"\n It is now available for others to reserve."
           );
           llResetScript();
       }
   }

} //========================================================================= // LICENCE: // Creative Commons Attribution-Share Alike 3.0 license // http://creativecommons.org/licenses/by-sa/3.0/ // You can modify this script, but you must prominently state that you // used this script, credit it's original author(s), and supply this // unaltered script with your modification. // // If you significantly rework my script: // I suggest that you include a full permissions notecard in your object called // 'CREDITS', into which you drag the original/unaltered version of this script. // OR // If you use my original script unaltered: (or just edit a few of my global variables) // Simply use my original script as-is: with the same (full) permissions, // and in the original script that lists BETLOG Hax as it's creator. // Either of these two options gives 'attribution' and complies with this licence. //=========================================================================

 </lsl>