Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

access list to teleport

Tony21 Jonesford
Registered User
Join date: 17 Sep 2007
Posts: 16
09-22-2007 15:20
Hi

I use this script to teleport

default
{
state_entry()
{
llSetSitText("Sortir";);
vector target=<182.0, 226.0, 22.0>;
rotation my_rot = llGetRot();
llSitTarget((target - llGetPos()) / my_rot,ZERO_ROTATION / my_rot);
}


changed(integer change)
{
if(change & CHANGED_LINK)
{
llSleep(0.5); // llUnSit works better with this delay
if (llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me
llUnSit(llAvatarOnSitTarget()); // unsit him or her
}
}
}


}



I would like to restrict access to a list of persons.

is it possible to intercept sit event and don't teleport a person who is not in the list?

thanks
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
09-22-2007 16:44
I don't think there's a way to intercept the event, but there are a couple of other options. The easiest would seem to be to switch to a warpPos-based teleporter, and just unsit the rider without moving if they're not approved. The harder way would be to clear the sit target after each teleport, and require the sitter-to-be to first touch the prim (perhaps selecting a destination) and only comply by setting the sit target if the sitter-to-be is approved... probably with a timeout to clear the sit target if nobody sits within a reasonable interval.

(If the teleport were *very* short distance--under 10m--the script could move the avatar by llSetLinkPrimitiveParams instead of by the sit target, but that would be a very specialized application of a teleporter.)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-22-2007 19:45
It is easier to have a sign that someone touchs. If they are not on the list then they recieve a message stating "You are not authorized to use this teleport". If they are on the list then an object will be rezzed with the sit target and they will TP if they touch it.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Tony21 Jonesford
Registered User
Join date: 17 Sep 2007
Posts: 16
09-23-2007 07:02
but how to Teleport when someone only touch the object?
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
09-23-2007 07:20
You're not going to be able to make a "single-stage" restricted-access teleport with this model of teleporter. The reason is because the teleport works on a SitTarget manipulation and you cannot manipulate the SitTarget once a person is seated.

The best solution is to make a "sign" or a "platform" that a person touches...and if they are not on the list, they receive a message saying so. If they are on the list, a 'teleporter' prim rezzes and the person can sit on it to teleport. In this manner, you can also build the teleporter prim to use warppos() and have a maximum distance of 1000+ meters teleported...
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-23-2007 07:49
From: Tony21 Jonesford
but how to Teleport when someone only touch the object?

When you make the rezzed object you can change the properties of "touch" in the edit window to among other things; "sit". Whenever you touch the object, even if it doesn't contain a script, you will automatically sit on it. In the case of a teleporter with a script in it, then you will automatically TP when you touch it. That option has been around for awhile and I laugh now when I still see teleporters that you have to right click and then pick "teleport" out of the pie menu.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-23-2007 07:52
From: Kenn Nilsson
You're not going to be able to make a "single-stage" restricted-access teleport with this model of teleporter. The reason is because the teleport works on a SitTarget manipulation and you cannot manipulate the SitTarget once a person is seated.

The best solution is to make a "sign" or a "platform" that a person touches...and if they are not on the list, they receive a message saying so. If they are on the list, a 'teleporter' prim rezzes and the person can sit on it to teleport. In this manner, you can also build the teleporter prim to use warppos() and have a maximum distance of 1000+ meters teleported...

Damn, I wish I had thought of that:

From: someone
It is easier to have a sign that someone touchs. If they are not on the list then they recieve a message stating "You are not authorized to use this teleport". If they are on the list then an object will be rezzed with the sit target and they will TP if they touch it.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
09-23-2007 08:56
Guess everybody has their favorite flavor of teleporter. Personally, I usually prefer a single prim warpPos that returns whence it came. (Under extreme lag, it can get delayed en route, but under those circumstances, rezzing a new one is lagged, too, in the "fire and forget" flavor of warpPos TPs). I use the "When left-clicked: Sit on Object" option Jesse mentioned; once there's an llAvatarOnSitTarget, I check authorization if needed, and if multiple destinations are supported then pop up a selection dialog.

I generally only use sit target for unauthorized, single-destination, one-click TPs, again with the Sit on Object left-click setting. I guess I prefer to keep fingers out of the pie menu as much as possible.
Tony21 Jonesford
Registered User
Join date: 17 Sep 2007
Posts: 16
09-23-2007 08:56
From: Jesse Barnett
It is easier to have a sign that someone touchs. If they are not on the list then they recieve a message stating "You are not authorized to use this teleport". If they are on the list then an object will be rezzed with the sit target and they will TP if they touch it.



but if a person who is in the list touchs and rezzed the object with the sit target, a person who are not in the list can use the teleport too.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-23-2007 09:31
From: Tony21 Jonesford
but if a person who is in the list touchs and rezzed the object with the sit target, a person who are not in the list can use the teleport too.

No, you make it so it will not rez the teleporter unless they are on the list.

Put this script in a sign for example:

CODE

list names = ["Tony21 Jonesford"];
list keys;
string teleporter;
vector pos;

default
{
state_entry()
{
teleporter = (string)llGetInventoryName(INVENTORY_OBJECT,0);
pos = llGetPos() + <0, 0, 0>;
}
touch_start(integer total_number)
{
list av_key = [];
av_key += llDetectedKey(0);
integer check_key = llListFindList(keys,av_key);
if(check_key > -1)
{
llRezObject(teleporter, pos, ZERO_VECTOR, ZERO_ROTATION, 0); }
else
{
list name = [];
name += llKey2Name(llList2Key(av_key,0));
integer check_name = llListFindList(names,name);
if(check_name == -1)
{
llSay(0, "You are not authorized to use this");
}
else
{
keys += av_key;
llRezObject(teleporter, pos, ZERO_VECTOR, ZERO_ROTATION, 0);
llSay(0, "You are authorized. Touch the sign again to teleport");
}
}
}
}


create another prim larger then the sign, you can texture it like you want or even make it transparent. While you are in edit mode go to the general tab and at the bottom under; "when left clicked", pick "Sit on object". Place this script in it and then put this prim w/script in the sign:

CODE

//Modified Teleport Script

vector target = <66,60,620>; // The location the av will be teleported to.

warpPos(vector target )
{
//with a little pokeing by Strife, and a bit more
//some more munging by Talarus Luan
//Final cleanup by Keknehv Psaltery
//and my own bungling/modificating/scriptulating
// Compute the number of jumps necessary
integer jumps = (integer)(llVecDist(target, llGetPos()) / 10.0) + 1;
if (jumps > 100 )
jumps = 100; // 1km should be plenty
list rules = [ PRIM_POSITION, target ];
integer count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules;
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
}

default
{
state_entry() {
llSitTarget(<0,0,0>,ZERO_ROTATION);
}

changed(integer change)
{
if(change & CHANGED_LINK)
{
warpPos(target);
llSleep(0.5);
llDie();
}
}
}

Now if you touch the sign and you are on the list then the teleporter will rez right where the sign is at and when touched, you will teleport. If you are not on the list then nothing will be rezzed and you will get a message: "You are not authorized to use this".
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-23-2007 09:45
You will notice that first I check to see if the key of the person that touches the sign is in the list and if it isn't then I make the simulator process the key2name request. Then I add the keys of people who are authorized to the key list so the simulator doesn't have to do the extra steps after the first time. Always try to take it as easy as possible on sim resources as you are learning.

If you want to be real sim friendly in this case then it would be better to collect the keys of the authorized people, create the key list and only check against it and do away with the key2name checking.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
09-23-2007 10:47
The way I handled security via an access list when I created my Beam-Me teleporters was to reset the sit text in the pie menu to "Stay here" after every use. Then the user would have to touch it first to use it. If I was restricting use based on a list, I would first check if llDetectedKey(0) was in the allowed list. If yes, then present a dialog menu wherein the user can choose a location, then set the pie menu to that location. So, TP'ing becomes a two step process when security is being used: Touch it to pick your destination, then use the substituted 'Sit' in the pie menu to effect the teleport.

By the way, this works regardless of whether you are using warpos or the sit hack to TP. Mine uses the sit hack because of the problems warpos has with crossing banned property. I would only use warpos if I needed to go up on my own property over the 300 m limit imposed by the sit hack.
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
10-07-2007 22:09
hi Jesse , its possible to add some body via chat and not opening the script ?
not using notecar just add via chat comand to this same script an compare the last time they teleport and if he teleport in the last 24 hrs cant teleport?
I think is some like and empty variable like this ..
CODE

/ some code atorized_lis=[]; //and put the keys of the avies inside and then compare the keys and the time they teleport .
if (las_time >=24)
{ llSay (0,"you cant teleport until the next day");
etc....

WARNING!! :Im very new on this :D