Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Restrictive Teleport

Ploy Vogel
Registered User
Join date: 27 Aug 2004
Posts: 133
01-03-2005 05:53
Here's what I have so far but I am getting an error. I want to set up two different TP areas, one for avies on the list and another for anyone else. The TP portion works fine but I am trying to get the conditional statement to work. The portion I added to the original TP script is in between the asterix, the rest of the code works.

Any help would be appreciated.

Thanks


key lastAVkey = NULL_KEY;
string fltText = "";

integer i;

float xAxis = 43.664;
float yAxis = 172.959;
float zAxis = 340.000;
************************************************** **
float xxAxis = 43.664;
float yyAxis = 150.000;
float zzAxis = 200.000;

list AllowedList= ["Avie1","Avie2"];
integer check_admitted_list (string name)
{
if ( llListFindList(AllowedList, [name]) >= 0 )
{
vector dest = <xAxis,yAxis,zAxis>;
} else
{
vector dest = <xxAxis,yyAxis,ZZAxis>;
}
}
************************************************** ***
default
{
state_entry()
{
llSetSitText("Teleport";);
llSetText(fltText, <1,1,1>, 1);
rotation curr = llGetRot();
curr.s = -curr.s;
vector dest2 = dest - llGetPos();
dest2 = dest2 * curr;
llSitTarget(dest2, <0,0,0,1> * curr);
}

touch_start(integer i)
{
llSay(0,"Right click me and chose 'Teleport'";);
}

changed(integer change)
{
key currentAVkey = llAvatarOnSitTarget();
if (currentAVkey != NULL_KEY && lastAVkey == NULL_KEY)
{
lastAVkey = currentAVkey;
if (!(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION))
llRequestPermissions(currentAVkey,PERMISSION_TRIGG ER_ANIMATION);
llUnSit(currentAVkey);
llStopAnimation("sit";);
llResetScript();
}
}
}
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
01-03-2005 06:09
i cant read when there isnt indentation
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Ploy Vogel
Registered User
Join date: 27 Aug 2004
Posts: 133
01-03-2005 06:23
just the code between the stars, not too much to look at.
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
01-03-2005 10:14
Well, two things:

One, your function check_admitted_list is never called anywhere in your script.

Two, your function check_admitted_list is declared as an integer type, but you have no return statements in the function to return an integer value.

The second of these two is likely what's giving you error messages. Either add return statements in each of the if conditionals, or just don't declare the function as an integer type.
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"