Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Pay 2 Teleport help

marc8300 Beltran
Registered User
Join date: 28 Dec 2006
Posts: 9
03-21-2007 01:13
Hello,

I'm not really a expert, far from, but i do understand some scripting, so i tried to pick bits and pieces from all kind of script in the attempt to get a pay 2 teleport script going, but it don't work,

The teleport works all the time if you pay or not and that is not what it should do, so can anybody help me in the right direction of what i'm doing wrong

All help welcome

Thank you

--- My code so far ----

vector target=<43,113,21>; // Enter the target coordinates here!!!
integer TPprice=5;

no_access() {
llSetSitText("Sit Here";);
llSitTarget(<0,0,0>, ZERO_ROTATION);
}

access() {
llSetSitText("Teleport";);
llSitTarget(target, ZERO_ROTATION);
}


default
{
state_entry()
{
llSetText("Pay to Teleport",<255,255,255>,5);
}
changed(integer change)
{
llUnSit(llAvatarOnSitTarget());
}
on_rez(integer start_param)
{
llResetScript();
}
money(key giver, integer amount)
{
if (amount < TPprice)
{
llSay(0, "Teleport costs L$" + (string) TPprice);
llSay(0, "You paid $L"+(string)amount+", which is not enough!";);
llGiveMoney(giver, amount);
no_access();
}
else
{
llSay(0, "Thank you for your purchase!";);
access();
if (amount > TPprice)
{
llGiveMoney(giver, amount - TPprice);
}

}
}
}
ZenMondo Wormser
Registered User
Join date: 19 Mar 2006
Posts: 26
03-21-2007 01:26
One problem I see is that once you pay the right amount or more, you turn on access, but you never turn it off again. It only turns off if one underpays. You might want to consider a timer event to turn access back off after a while.

Another problem is that once turned on, any number of avatars can use it until it is turned off again.
marc8300 Beltran
Registered User
Join date: 28 Dec 2006
Posts: 9
Ok
03-21-2007 02:28
From: ZenMondo Wormser
One problem I see is that once you pay the right amount or more, you turn on access, but you never turn it off again. It only turns off if one underpays. You might want to consider a timer event to turn access back off after a while.

Another problem is that once turned on, any number of avatars can use it until it is turned off again.


Thing is, if you pay or not you can alway teleport and that i don't unnderstand why it happens,

but thanks for the turn off advice
will keep on working the script
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-21-2007 05:43
From: marc8300 Beltran
Thing is, if you pay or not you can alway teleport and that i don't unnderstand why it happens,

but thanks for the turn off advice
will keep on working the script



The reason it always works was stated above, once you set up a sit target anyone sitting will automatically be unsat at the destination. You need to explicitly turn off the sit target and only turn it on when some one pays. Then immediately turn it off again.

Another problem is the way its currently written it does not care who paid and who it unists at the destination. It will accept money without recording who paid and then just unsit who ever sits on it.

I also notice you dont request debit permissions so you will be unable to pay back any amounts paid in excess of the required amount.
marc8300 Beltran
Registered User
Join date: 28 Dec 2006
Posts: 9
still haveing the same problem
03-21-2007 10:25
I understand what you are saying, thing is anybody clicking the object get's the word teleport in there pie menu, if they paid or not, the reason for that is what i don't understand, or i must be blocked on looking into the script,

Somewhere else in the forum is a selective teleoport script, that allows pleople in the list to use the teleport, i used this a s a based, but there if i put my name in the list or not i can never teleport, so .........

maybe a example would be ver very nice

thanks