Difference between revisions of "Lot Reservation"

From Second Life Wiki
Jump to navigation Jump to search
(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...)
 
m
Line 16: Line 16:
<lsl>
<lsl>
//=========================================================================
//=========================================================================
// LICENCE:
// ---LICENCE START---
//  Creative Commons Attribution-Share Alike 3.0 license
// http://creativecommons.org/licenses/by-sa/3.0/
// http://creativecommons.org/licenses/by-sa/3.0/
// ie: Attribution licence:
// You can modify this script, but you must prominently state that you
//   Give me credit by leaving it in the script I created.
// used this script, credit it's original author(s), and supply this
//   Supply my original script with your modified version.
//  unaltered script with your modification.
//   Refer to the wiki URL from which you copied this script.
//
//     https://wiki.secondlife.com/wiki/Lot_Reservation
//  If you significantly rework my script:
// ---LICENCE END---
//      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
// SHARED CONFIGURATION
integer    gPayloadPIN        = -81520;
integer    gPayloadPIN        = -81520;
Line 85: Line 79:
}
}
//=========================================================================
//=========================================================================
// 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>
   </lsl>
</div>
</div>


{{LSLC|Examples|Lot Reservation}}
{{LSLC|Examples|Lot Reservation}}

Revision as of 08:57, 6 June 2009

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 START--- // http://creativecommons.org/licenses/by-sa/3.0/ // ie: Attribution licence: // Give me credit by leaving it in the script I created. // Supply my original script with your modified version. // Refer to the wiki URL from which you copied this script. // https://wiki.secondlife.com/wiki/Lot_Reservation // ---LICENCE END--- //=========================================================================

// 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();
       }
   }

} //=========================================================================

 </lsl>