Stop a Sit?
|
|
Shifting Dreamscape
Always questioning ...
Join date: 12 Dec 2007
Posts: 266
|
08-09-2008 18:11
Is there anyway to stop someone from sittting?
I have a teleport script that I have written that uses the sit function (as do many). In a situation where there is only one destination confiigured, I wanted to set the teleport on sit automaticly, to avoid the menus .. and this worked fine until .... I decided to add locking and user access list functionality. As long as there is more than one possible destination, then great, I can control who teleports ...but with only one destination the code sets the teleporgt and I can't seem to find if there is a way to block it when someone who does not have authorization tries to sit (i.e. teleport).
Any possibility?
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
08-09-2008 18:36
What I did once was have the prim rotate 90 degrees if the person wasn't on the access list, so they ended up buried in the ground beneath the teleporter until SL spit them out again.  I don't know of a way to prevent sitting or otherwise disable a sit target teleporter dynamically - by the time the person has sit down it's too late for a script to do anything about it, they are already there. There's a newer style one-prim teleporter going around these days based on llSetLinkPrimitiveParams that actually moves the avatar rather than sort of "warping" them like sit target TPs do - the way the function works though is kind of flaky and changing over the recent server updates, so it's not exactly ready for prime time yet. Might be worth taking a look at though. Here's a thread that discusses and provides a fix for one of the issues: /54/03/267096/1.htmlWith a TP like that, there's plenty of opportunity for the script to detect the key (name, group, etc) of the seated avatar and decide whether or not to teleport them.
_____________________
Designer of sensual, tasteful couple's animations - for residents who take their leisure time seriously.  http://slurl.com/secondlife/Brownlee/203/110/109/ 
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
08-09-2008 18:37
If you are using the llSitTarget trick to move the avatar, you do have a problem  To yank the avatar back, you can experiment with llSetLinkPrimitiveParams, but that function is having some problems right now (link to a thread discussing the trouble and workarounds below). That said, if you decide on llSetLinkPrimitiveParams to retrieve the avatar, you may as well just use that and avoid the original problem. The thread with the current problems and workarounds: /54/03/267096/1.htmlETA: Oh no, duplicate answers, call the cavalry! 
|
|
roxxkatt Xue
Junior Member
Join date: 8 Aug 2008
Posts: 5
|
08-10-2008 00:36
llUnSit(key id);
|
|
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
|
08-10-2008 12:13
To expand on roxxkatt's reply. As far as I know all tp's rely on detecting the sitting av in the changed event. All you have to do is check if they are allowed to tp at that point, if not just unsit them again. something like this code fragment
changed(integer change) { if (change & CHANGED_LINK) { key av = llAvatarOnSitTarget(); if(av != NULL_KEY) { if(av == "whatever you want to test here") { // Do the teleport code } else // They are not allowed to tp { llSay(0, "Get Off"); llUnsit(av); } } } }
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
08-10-2008 12:17
llSitTarget teleporters move the avatar immediately, llUnsit is used in normal operation to drop the avatar off at its destination. That's the original problem, the avatar is moved before a script can do anything about it, because the sit target is a prim property rather than something actively performed by the script.
|
|
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
|
08-10-2008 14:20
Ahhh! I understand the problem now  In that case messing about with llSetLinkPrimitiveParams does seem to be the only solution. Or change to a different type of tp that would let you intercept the sit, probably the easiest solution 
|
|
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
|
08-10-2008 18:49
You could do the "security check" in the changed event handler, and if not authorised, move the av back to the TP's physical location (or some convenient nearby "dumping" spot) with llSetLinkPrimitiveParams, hopefully before they unsit manually at the destination (which might be possible under heavy lag).
'Course, if llSetLinkPrimitiveParams would move an av as far away from the prim as llSitTarget, instead of restricting them to link distance, the check could be done before hand, instead of being used as "cleanup" afterward.
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
08-10-2008 19:11
Yep, but llSetLinkPrimitiveParams is a little broken right now, so you have to play around with prim arrangements and may need to fuddle with the rotation too to make it all work. There should be a thread or two around about that somewhere.
|