I have finally figured out my teleporter system, thanks be to all. Now I have stumbled into a security dilemma.
Obviously, once someone teleports to a parcel, they have the coordinates, therefore, is there some way to automatically add people who teleport to a "white list" and ban all others from the parcel?
If so, what is your preferred method?
This is supposed to be as much of a "noob-friendly" environment as possible, so I'm trying to avoid explaining to them how to join a group, this and that, unless I can automate that. (Was under the impression I couldn't)
Thanks tons, and in return, here is my finally finished pay-per-teleport script. it uses one ";" parsed note card for vector,cost,a few lines of hover text, and a public access switch.
Feel free to use and abuse, improve and improvise, just please leave my name and those who made the warp script intact within the script.
CODE
//Pay-Per-Teleport v1.6 by Haplo Voss
//Please note that the long-distance warp / teleport script itself
//below has commented information regarding the creators
//and developers. Please note their major contribution to my
//project! Without them, this would have taken me much longer
//to write that portion myself! :)
vector gTargetPos;
integer cost;
string desc;
string hovertext;
key agent;
key gAvatarID=NULL_KEY;
integer gReturnToStartPos=TRUE;
vector gStartPos;
integer paid = 1;
integer access=0;
integer public_access;
warpPos( vector destpos)
{ //R&D by Keknehv Psaltery, 05/25/2006
//Additions by Strife, Talarus Luan
//and final cleanup by Keknehv Psaltery
integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1;
if (jumps > 100 )
jumps = 100;
list rules = [ PRIM_POSITION, destpos ];
integer count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules;
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
}
default
{
dataserver(key query_id, string desc){
list desc_list = llParseString2List(desc, [";"], []);
gTargetPos = (vector)llList2String(desc_list, 0);
cost = (integer)llList2String(desc_list, 1);
hovertext = llList2String(desc_list, 2) + "\n" +
llList2String(desc_list, 3) + "\n" +
llList2String(desc_list, 4) + "\n" +
llList2String(desc_list, 5) + "\n" +
llList2String(desc_list, 6);
public_access = (integer)llList2String(desc_list, 7);
}
money (key id, integer amount){
paid=amount;
if (paid < cost){
llSay(0,"Sorry, but this class costs " + (string)cost + ". Full amount is required before access.");access=0;
llGiveMoney(id,paid);
llUnSit(llAvatarOnSitTarget());
access=0;
}
else if (paid > cost){
integer refund = paid - cost;
llSay(0,"This class only costs " + (string)cost + "! Refunding you L$" + (string)refund );
llSay(0,"Access Granted!");
llSetSitText("Teleport");
llGiveMoney(id,refund);
access=1;
}
else{
llSay(0,"Access Granted!");
llSetSitText("Teleport");
access=1;
}
}
state_entry(){
llRequestPermissions(llGetOwner(),PERMISSION_DEBIT);
desc = llGetNotecardLine("TPInfo",0);
llSitTarget(<0,0,1>,ZERO_ROTATION);
gStartPos = llGetPos();
}
touch_start(integer touched){
llSetSitText("\n");
llSetText(hovertext, <1,0,0>, 1);
access=0;
if (public_access == 1){
paid = 0;
cost = 0;
access = 1;
llSay(0,"Access Granted!");
llSetSitText("Teleport");
}
}
changed(integer change){
if(change & CHANGED_LINK)
gAvatarID = llAvatarOnSitTarget();
if(access == 0){llUnSit(gAvatarID);}
if(gAvatarID != NULL_KEY & access == 1) {
{
warpPos(gTargetPos);
llSleep(.5);
llUnSit(gAvatarID);
llSleep(.5);
if (gReturnToStartPos) {
warpPos(gStartPos);
llSetSitText("\n");
access=0;
paid=0;
}
}}
}}
Sample Note card:
Name of Note card: TPInfo
Contents:
<40,13,116>;150;Top Line of Text;Next Line of Text;3rd Line of Text;4th Line of Text;5th Line of Text;0;
(vector,cost,line1,line2,line3,line4,line5,access switch (0=private/pay, 1=public/free))
Thank you!
;