Saturday, October 9, 2010

How To Size Basketball Jersey

parameters: a simple "access list"

This simple script can be used for various applications (think of the doors on a vehicle, a control panel, etc). We will create an access list, so that only authorized avatar (the names in the list of course) can get permission for certain actions.


This code example uses a collision and a list.

We have a surface that becomes
phantom (ie via) only if the avatar is colliding on the list. Suppose that the code will apply to a door, will be the following:

//-------------------------------- ------------------------------------------

list access_list = ["Sergio Delacruz","Nome2 Cognome2", "Nome3 Cognome3"]; default {
   
state_entry
( )
    {
    
llSetStatus
(STATUS_PHANTOM, FALSE);  
    }
    collision (integer num_detected)
    {
        if(~
llListFindList
(access_list, (list)
llDetectedName
(0)))
        {
           
llSetStatus
(STATUS_PHANTOM, TRUE);
         
   llSetTimerEvent
(5);
        } else ; {
llSay
(0, "Not in list !!");
}}
timer () {
llSetStatus
(STATUS_PHANTOM, FALSE);}
}
//------------------- -------------------------------------------------- -


What have we done?
We defined a simple list with the names allowed (each quotation marks and separated by a comma) At the state phantom is set false, so it can not be crossed. When a collision occurs, if the name is found in the list (we used the command
llFindList
(), which is an item in the list access_list), then the surface becomes a phantom and a timer and after 5 seconds, the relocks surface making it non-phantom again (if you've seen the topic of the event timer, there should be quite clear)
Otherwise (else), simply say "You're not on the list!"

Later we will create more complex ones, to write an access list on a notecard (Much more convenient to handle than a script).

0 comments:

Post a Comment