Advertisement
Guest User

Untitled

a guest
Apr 15th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // author: harold134
  2. // 4/1/2018
  3.  
  4. integer votes = 0;
  5. key hmcgID = "c609ac38-1e49-1d46-b801-71b6c0c1e5a6";
  6. list touched;
  7. default
  8. {
  9.    
  10.      state_entry()
  11.     {
  12.         votes =0;
  13.         llSetText("Votes: " + (string) votes, <1.0,1.0,1.0>, 1);
  14.     }
  15.  
  16.     touch_start(integer total_number)
  17.     {
  18.         key id = llDetectedKey(0);
  19.        
  20.         // hack to check object group matches user group - thanks to Pazako Karu
  21.          list l = llGetAttachedList(id);
  22.         key group_id = llList2Key(llGetObjectDetails(llList2Key(l, 0), [ OBJECT_GROUP ]), 0);
  23.            if(group_id != hmcgID) {
  24.                
  25.                       llSay(0, "Sorry secondlife:///app/agent/" + (string) llDetectedKey(0) +"/about, your vote has not been counted. If you are an HMCG memeber, make sure you are wearng the group tag.");
  26.                
  27.                }                
  28.                
  29.                else if (llListFindList(touched,[id])!=-1)
  30.                 {
  31.                         llSay(0, "Sorry secondlife:///app/agent/" + (string) llDetectedKey(0) +"/about, you have already voted for this picture.");
  32.                 }      
  33.  
  34.                
  35.                 else if(llListFindList(touched,[id])==-1)
  36.                 {
  37.                     touched+=[id];
  38.                     votes = votes+1;
  39.                      llSetText("Votes: " + (string) votes, <1.0,1.0,1.0>, 1);
  40.                         llSay(0, "Thanks for voting, secondlife:///app/agent/" + (string) llDetectedKey(0) +"/about!");
  41.        
  42.                 }
  43.  
  44.         }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement