Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer index;
- integer numlandmarks;
- menu(key id)
- {
- list buttons = ["<<","Cancel",">>"];
- integer i = index;
- string text = "Choose a destination";
- while(i < (index+9) && i < numlandmarks)
- {
- buttons += (string)(i+1);
- text += llDumpList2String(["\n",i+1,". " +llGetInventoryName(INVENTORY_LANDMARK,i)],"");
- i++;
- }
- llDialog(id,text,buttons,Dchan);
- }
- string destination;
- integer Dchan;
- default
- {
- state_entry()
- {
- Dchan = (integer)llFrand(-5000)-7000;
- numlandmarks = llGetInventoryNumber(INVENTORY_LANDMARK);
- llListen(Dchan,"","","");
- }
- on_rez(integer n)
- {
- llResetScript();
- }
- touch_start(integer total_number)
- {
- key id = llDetectedKey(0);
- menu(id);
- }
- listen(integer chan, string name, key id, string message)
- {
- if(message == "<<")
- {
- index -= 9;
- if(index < 0)index = numlandmarks-9;
- menu(id);
- }
- else if(message == ">>")
- {
- index += 9;
- if(index >= numlandmarks)index = 0;
- menu(id);
- }
- else if(message == "Cancel")
- {
- index = 0;
- }
- else
- {
- destination = llGetInventoryName(INVENTORY_LANDMARK,((integer)message)-1);
- llRequestExperiencePermissions(id,"");
- index = 0;
- }
- }
- experience_permissions(key id)
- {
- llTeleportAgent(id,destination,ZERO_VECTOR,ZERO_VECTOR);
- }
- changed(integer change)
- {
- numlandmarks = llGetInventoryNumber(INVENTORY_LANDMARK);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement