Difference between revisions of "LlAddToLandBanList/zh-Hant"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{Issues/SVC-1911}}{{LSL_Function/avatar|avatar}}{{LSL_Function/zh-Hant |func_id=310|func_sleep=0.1|func_energy=10.0 |func=llAddToLandBanList|sort=AddToLandBanList |p1_type=key|p…")
 
m (oh good zh-Hant has inject-2)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Issues/SVC-1911}}{{LSL_Function/avatar|avatar}}{{LSL_Function/zh-Hant
{{LSL_Function/zh-Hant
|inject-2={{LSL_Function/avatar|avatar}}{{Issues/SVC-1911}}
|func_id=310|func_sleep=0.1|func_energy=10.0
|func_id=310|func_sleep=0.1|func_energy=10.0
|func=llAddToLandBanList|sort=AddToLandBanList
|func=llAddToLandBanList|sort=AddToLandBanList
|p1_type=key|p1_name=avatar|p2_type=float|p2_name=hours
|p1_type=key|p1_name=avatar|p2_type=float|p2_name=hours
|func_footnote
|func_footnote
|func_desc=將'''avatar'''加入土地黑名單持續'''hours'''小時,若'''hours'''設為0則時間為無限
|func_desc=將'''avatar'''加入土地黑名單持續'''hours'''小時,若'''hours'''設為0則時間為無限。
|return_text
|return_text
|spec
|spec

Latest revision as of 09:31, 19 September 2011

概要

函式: llAddToLandBanList( key avatar, float hours );
310 函式ID
0.1 延遲
10.0 能量

avatar加入土地黑名單持續hours小時,若hours設為0則時間為無限。

• key avatar avatar UUID
• float hours

注意事項

  • 這函式會導致script延遲 0.1 秒。
  • 要使用此函式的話,script擁有者必須是土地的擁有者。

範例

<lsl>// 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 = 0;
       for (; 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 = "";
   }
}</lsl>

Deep Notes

All Issues

~ Search JIRA for related Issues
   llAddToLandBanList, either permanently or no more than 8640 minutes (aka: 144 hours/6 days)