SHOW:
|
|
- or go back to the newest paste.
| 1 | // list of people's prims to keep (owner UUIDs) | |
| 2 | list do_not_return = | |
| 3 | [ | |
| 4 | "6a5aef83-93a6-42e1-9d76-bd03b4f5e8aa", // Darien Caldwell | |
| 5 | "b91d12f1-4e0f-4752-8199-73d71fdeeee5" // Lucia Nightfire | |
| 6 | ]; | |
| 7 | // list of people who can trigger a cleanup (return) | |
| 8 | // doesn't have to be the same as above, but probably will be | |
| 9 | list allowed_to_trigger_return = | |
| 10 | [ | |
| 11 | "6a5aef83-93a6-42e1-9d76-bd03b4f5e8aa", // Darien Caldwell | |
| 12 | "b91d12f1-4e0f-4752-8199-73d71fdeeee5" // Lucia Nightfire | |
| 13 | ]; | |
| 14 | default | |
| 15 | {
| |
| 16 | state_entry() | |
| 17 | {
| |
| 18 | llRequestPermissions(llGetOwner(),PERMISSION_RETURN_OBJECTS); | |
| 19 | } | |
| 20 | ||
| 21 | on_rez(integer param) | |
| 22 | {
| |
| 23 | llRequestPermissions(llGetOwner(),PERMISSION_RETURN_OBJECTS); | |
| 24 | } | |
| 25 | ||
| 26 | run_time_permissions(integer perm) | |
| 27 | {
| |
| 28 | if (perm & PERMISSION_RETURN_OBJECTS) | |
| 29 | {
| |
| 30 | llOwnerSay("Permission Granted, ready to return stuff!");
| |
| 31 | } | |
| 32 | } | |
| 33 | ||
| 34 | touch_start(integer total_number) | |
| 35 | {
| |
| 36 | string toucher = llDetectedKey(0); | |
| 37 | if (llListFindList(allowed_to_trigger_return,[toucher]) != -1 || toucher == llGetOwner()) | |
| 38 | {
| |
| 39 | // get list of prim owners on parcel | |
| 40 | list prim_owners = llGetParcelPrimOwners(llGetPos()); | |
| 41 | list prim_interlopers=[]; | |
| 42 | integer x=0; | |
| 43 | ||
| 44 | llRegionSayTo(toucher,0,"Prim Owners Detected"); | |
| 45 | llRegionSayTo(toucher,0,"\n--------------------"); | |
| 46 | do {
| |
| 47 | llRegionSayTo(toucher,0,llList2String(prim_owners,x)+": "+llList2String(prim_owners,x+1)+" objects."); | |
| 48 | if (llListFindList(do_not_return,[llList2Key(prim_owners,x)]) == -1) | |
| 49 | {
| |
| 50 | // not on the keep list, so queue for removal | |
| 51 | prim_interlopers+=llList2Key(prim_owners,x); | |
| 52 | } | |
| 53 | x=x+2; | |
| 54 | } | |
| 55 | while(llGetListLength(prim_owners)>x); | |
| 56 | ||
| 57 | // if we have prims to delete, do it. | |
| 58 | if (prim_interlopers!= []) | |
| 59 | {
| |
| 60 | x=0; | |
| 61 | do {
| |
| 62 | - | llReturnObjectsbyOwner(llList2Key(prim_interlopers,x),OBJECT_RETURN_PARCEL); |
| 62 | + | llReturnObjectsByOwner(llList2Key(prim_interlopers,x),OBJECT_RETURN_PARCEL); |
| 63 | x++; | |
| 64 | } | |
| 65 | while(llGetListLength(prim_interlopers)>x); | |
| 66 | } | |
| 67 | ||
| 68 | } | |
| 69 | } | |
| 70 | } |