Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // author: harold134
- // 4/1/2018
- integer votes = 0;
- key hmcgID = "c609ac38-1e49-1d46-b801-71b6c0c1e5a6";
- list touched;
- default
- {
- state_entry()
- {
- votes =0;
- llSetText("Votes: " + (string) votes, <1.0,1.0,1.0>, 1);
- }
- touch_start(integer total_number)
- {
- key id = llDetectedKey(0);
- // hack to check object group matches user group - thanks to Pazako Karu
- list l = llGetAttachedList(id);
- key group_id = llList2Key(llGetObjectDetails(llList2Key(l, 0), [ OBJECT_GROUP ]), 0);
- if(group_id != hmcgID) {
- 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.");
- }
- else if (llListFindList(touched,[id])!=-1)
- {
- llSay(0, "Sorry secondlife:///app/agent/" + (string) llDetectedKey(0) +"/about, you have already voted for this picture.");
- }
- else if(llListFindList(touched,[id])==-1)
- {
- touched+=[id];
- votes = votes+1;
- llSetText("Votes: " + (string) votes, <1.0,1.0,1.0>, 1);
- llSay(0, "Thanks for voting, secondlife:///app/agent/" + (string) llDetectedKey(0) +"/about!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement