04-09-2008 05:29
Based on an idea from an earlyer thread

CODE

//SURL based TP system, inspierd by origonal work of Rock Ryder
//Very Keynes - Aprill 2008 - Version 1.0
//Iter and Intra Region Teleporter with public and private access.

// menu items - items containing * will be restricted to the access list
list Menu = [
"Salsa",
"RYC",
"Beach",
"Mall",
"*Castle"
];

//destinations and their vectors now follow
list targ = [
"Seopophang/71/80/94", //Salsa Romantica
"Jeffrey/42/221/22", //Romantica Yacht Club
"Jeffrey/15/243/21", //Lara's Light House
"Seopophang/63/110/92", //Romantica Mall
"Seopophang/63/110/92" //Home - bogus link for testing
];

//access list for restricted areas
list admin = [
"Very Keynes",
"Simnelia Petrichor"
];

//other variables
integer handle;
key id;

default
{

state_entry()
{
llSetText("Romantica Teleporter",<0.875,0.746,0.547>,1);
}

touch_start(integer num)
{
id = llDetectedKey(0); //get id of person touching
handle = llListen(-7652384, "", id, "");
llDialog(id, "Select a destination - then click on the SURL returned in your chat history."
+"\n Destinations with * are restricted", Menu, -7652384);
llSetTimerEvent(30);
}
listen(integer channel, string name, key id, string message)
{
llListenRemove(handle);
llSetTimerEvent(0);
integer index = llListFindList(Menu, [ message]);
if(!(~llSubStringIndex(message,"*")))
llInstantMessage(id,"http://slurl.com/secondlife/"+llList2String(targ,index));
else if(llListFindList(admin, [name]) >= 0)
llInstantMessage(id,"http://slurl.com/secondlife/"+llList2String(targ,index));
else llInstantMessage
(id,"Sorry "+llGetSubString(name,0,llSubStringIndex(name, " "))+
" but access to "+message+" is restricted");
}

timer()
{
llListenRemove(handle);
llSetTimerEvent(0);
llWhisper(0, "Menu timeout.");
}
}