How easy to add a "Only these Avatars" to a TP script?
|
|
Piggie Paule
Registered User
Join date: 22 Jul 2008
Posts: 675
|
03-06-2009 08:54
I have a nice simple free TP script that just "does the job" so to speak (think it originally came from here)
Is it resonably easy to add into such an item a extra few line that contain two or three Avatar names, and only people who's names are there can use it?
Don't need any messages to others, or anything.
Just is someone who is not in the program listing clicks it, (the prim) nothing happens.
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
03-06-2009 09:07
In the touch_start event, just put in an if test to compare llDetectedName with each of the specific avatar names. If TRUE, proceed. Otherwise, don't. See 
|
|
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
|
03-06-2009 09:50
list Access = ["My mame", "your Name", "his name", Her name"]; if(~llListFindList(Access, [llDetectedName(0)]) { llInstantMessage(llDetectedKey(0), "Sorry, you are not on my list"  ; } else { //your TP function here }
|
|
Piggie Paule
Registered User
Join date: 22 Jul 2008
Posts: 675
|
03-06-2009 09:58
Wow, many thanks for that, will have a fiddle and see if I have any luck 
|
|
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
|
03-06-2009 10:02
From: Very Keynes list Access = ["My mame", "your Name", "his name", Her name"]; if(~llListFindList(Access, [llDetectedName(0)]) { llInstantMessage(llDetectedKey(0), "Sorry, you are not on my list"  ; } else { //your TP function here } Should'nt that be "if(!~llListFindList(Access, [llDetectedName(0)])"? (notice the ! before ~)
|
|
Piggie Paule
Registered User
Join date: 22 Jul 2008
Posts: 675
|
03-06-2009 11:23
From: Very Keynes list Access = ["My mame", "your Name", "his name", Her name"]; if(~llListFindList(Access, [llDetectedName(0)]) { llInstantMessage(llDetectedKey(0), "Sorry, you are not on my list"  ; } else { //your TP function here } Thanks for this, but I can't figure out how to integrate this inti my script (dont VERY little script stuff on SL as of yet) May I send you the script in-world or post here? (f you have time)
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
03-06-2009 11:41
As I suggested earlier, you put it in the touch_start event, right where the script currently does whatever it does when you touch it. The current stuff goes where Very wrote "// your TP function here." Give it a try. BTW, when you type the list of avatar names into the list Access declaration, be sure that each name is spelled (and capitalized) exactly the way it is in SL and that you place it in quotes.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-06-2009 12:27
From: Ron Khondji Should'nt that be "if(!~llListFindList(Access, [llDetectedName(0)])"?
(notice the ! before ~) good catch. or switch the logic of the functions personally I prefer if (~find){ //--do } because I'm mean and want them to wonder about the silent failure (actually because only my users need feedback in this scenario)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
|
03-06-2009 14:36
I always seam to reverse my logic with the ~ function, especially when I type a quick reply and don't test in LSLEditor. Would have been fun to debug till the OP realised that anyone not on the list could TP 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-06-2009 19:20
From: Very Keynes Would have been fun to debug till the OP realised that anyone not on the list could TP  I admit to having done that before =X
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|