Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Ok - Im sure this is a really simply one --- but cant find it.

Timmins Hamilton
Registered User
Join date: 15 May 2004
Posts: 68
05-07-2006 04:21
Hi People,

This is a very simple request and Im sure its been asked 1,000,000,000 times before but I cant find reference to it and after looking through the wiki and forum am none the wiser.

I have an object door script that currently allows an override list for people who should be able to open the door even when it has been locked by the owner. I want to modify this so that its possible for everyone in the override list to actually lock/unlock the door as well as open a locked one.

The problem is that for opening the door I can use llDetectedName to capture the av trying to open the door and llListFindList with llCSV2List to check if that user has permission to do so...... Easy as the user has touched to door. However not so simple (at least to me) when the user is Saying "lock door" for example. I have a listener listening to NULL_KEY and it will repond to all users, but then what? I cant use llDetectedName anymore because noone has touched the door. Is there a simple way of getting the name of the av/object that is talking?

Cheers

Timmins
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
05-07-2006 04:48
If the person said "lock door" then you are picking it via listen which will hold the person's name & key.

listen ( integer ch, string name, key id, string mess )

use the name to check your list.

If the person is wearing something that says "lock door" and you wish to allow it, use the key to get the person's name..

name = llKey2Name( llGetOwnerKey( id )) ;

Or if you have a situation where you have the person's key but not their name (cant think of one right now ) and you know they are in the same sim as you use

name = llKey2Name( id );

Hope that helps.
Timmins Hamilton
Registered User
Join date: 15 May 2004
Posts: 68
05-07-2006 05:21
Doh!

I said I knew is was something really simple, I just need to use the "name" variable that is passed. My excuse is that I havent had any coffee yet!

Thanks for the kick!

Timmins