# llAddToLandPassList

*LSL function*

```lsl
void llAddToLandPassList(key avatar, float hours);
```

- `key avatar`: UUID of the avatar to add to the pass list.
- `float hours`: Duration, in hours, to allow the avatar for (range [0.0, 144.0], 0 for indefinite).

- Delay: 0.1 s
- Energy: 10

Adds the avatar to the land pass list for the specified number of hours (or indefinitely if hours is 0).

Add **avatar** to the land pass list for **hours**, or indefinitely if **hours** is zero.

```lsl title="How to use" frame="terminal"
llAddToLandPassList(NULL_KEY, 0.0);
```

## Caveats

- The maximum usable value for **hours** is 144. Any value greater than 144 will be silently reduced to 144.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-76, 82-88}
// This is not a complete solution, requires full avatar names to work - even for unbanning someone!
// This is meant only as an example of the land ban and pass management functions.
// free to copy, use, modify, distribute - just don't ask me to debug your modified code. ;-)
//
// Commands are:
//   /5 ban:full_avatar_name
//   /5 tempban:full_avatar_name
//   /5 unban:full_avatar_name
//   /5 pass:full_avatar_name
//   /5 unpass:full_avatar_name
//   /5 clearban
//   /5 clearpass

string command;

default
{
    state_entry()
    {
        llListen(5, "", llGetOwner(), "");
    }

    on_rez(integer param)
    {
        llResetScript();
    }

    listen(integer chan, string name, key id, string message)
    {
        if (command != "")
        {
            llOwnerSay("Sorry, still processing last command, try again in a second.");
        }

        list args = llParseString2List(message,[":"],[]);
        command = llToLower(llList2String(args,0));

        if (command == "clearbans")
        {
            llResetLandBanList();
        }
        if (command == "clearpass")
        {
            llResetLandPassList();
        }
        else
        {
            llSensor(llList2String(args,1),NULL_KEY,AGENT,96,PI);
        }
    }

    no_sensor()
    {
        command = "";
    }

    sensor(integer num)
    {
        integer i;
        for (i=0; i< num; ++i)
        {
            if (command == "ban")
            {
                // Ban indefinetely
                llAddToLandBanList(llDetectedKey(i),0.0);
            }
            if (command == "tempban")
            {
                // Ban for 1 hour.
                llAddToLandBanList(llDetectedKey(i),1.0);
            }
            if (command == "unban")
            {
                llRemoveFromLandBanList(llDetectedKey(i));
            }
            if (command == "pass")
            {
                // Add to land pass list for 1 hour
                llAddToLandPassList(llDetectedKey(i),1.0);
            }
            if (command == "unpass")
            {
                llRemoveFromLandPassList(llDetectedKey(i));
            }
        }
        command = "";
    }
}
```

</details>

## See also

### Functions

- [llAddToLandBanList](/functions/llAddToLandBanList/)
- [llRemoveFromLandBanList](/functions/llRemoveFromLandBanList/)
- [llRemoveFromLandPassList](/functions/llRemoveFromLandPassList/)
- [llResetLandBanList](/functions/llResetLandBanList/)
- [llResetLandPassList](/functions/llResetLandPassList/)

---

*Source: [LlAddToLandPassList](https://wiki.secondlife.com/wiki/LlAddToLandPassList) on the Second Life Wiki. Content from the Second Life Wiki articles LlAddToLandPassList (revision 1194048, 2015-01-22) and Template:LSL Function/avatar (revision 1179236, 2013-06-15), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llAddToLandPassList/
