Advertisement
Guest User

Untitled

a guest
May 6th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. list Prices = [100,250,500,1000];
  3. integer minimum = 1;
  4. //key receiver = "1451b2c5-1028-4caa-9f1b-7abdd92dbdc0"; //scifiexpo avatar
  5. key receiver = "7b7e36b2-3349-46cb-a512-f7c9dd0d4a9e"; //richmerk avatar
  6. string msg_success = "Thank you for your donation! Your vote has been cast!";
  7. string msg_fail = "Please donate at least $1L.";
  8. integer total = 0;
  9.  
  10. key donor;
  11.  
  12. default
  13. {
  14.     on_rez(integer start_param)
  15.     {
  16.         llResetScript();
  17.     }
  18.     state_entry()
  19.     {
  20.         llResetScript();
  21.         llSetText("", <1.0, 1.0, 1.0>, 1.0);
  22.         llTargetOmega(<0, 0, 0.25>, 1.0, 1.0);
  23.         llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
  24.     }
  25.     run_time_permissions(integer perm)
  26.     {
  27.         if(perm & PERMISSION_DEBIT)
  28.             state cash;
  29.     }
  30. }
  31.  
  32. state cash
  33. {
  34.     state_entry()
  35.     {
  36.         llResetScript();
  37.         llSetPayPrice(minimum, Prices);
  38.         llSetClickAction(CLICK_ACTION_PAY);
  39.     }
  40.     money(key id, integer amount)
  41.     {
  42.         if(amount >= minimum)
  43.         {
  44.             llGiveMoney(receiver , amount);
  45.             llRegionSayTo(id, 0, msg_success);
  46.             llInstantMessage(receiver, llGetDisplayName(id) + " paid you $" + (string)amount + "L.\n");
  47.             donor = id;
  48.             total += amount;
  49.             llSetText((string)total + " L$", <1.0, 1.0, 1.0>, 1.0);
  50.         }
  51.         else
  52.         {
  53.             llRegionSayTo(id, 0, msg_fail);
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement