Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list Prices = [100,250,500,1000];
- integer minimum = 1;
- //key receiver = "1451b2c5-1028-4caa-9f1b-7abdd92dbdc0"; //scifiexpo avatar
- key receiver = "7b7e36b2-3349-46cb-a512-f7c9dd0d4a9e"; //richmerk avatar
- string msg_success = "Thank you for your donation! Your vote has been cast!";
- string msg_fail = "Please donate at least $1L.";
- integer total = 0;
- key donor;
- default
- {
- on_rez(integer start_param)
- {
- llResetScript();
- }
- state_entry()
- {
- llResetScript();
- llSetText("", <1.0, 1.0, 1.0>, 1.0);
- llTargetOmega(<0, 0, 0.25>, 1.0, 1.0);
- llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
- }
- run_time_permissions(integer perm)
- {
- if(perm & PERMISSION_DEBIT)
- state cash;
- }
- }
- state cash
- {
- state_entry()
- {
- llResetScript();
- llSetPayPrice(minimum, Prices);
- llSetClickAction(CLICK_ACTION_PAY);
- }
- money(key id, integer amount)
- {
- if(amount >= minimum)
- {
- llGiveMoney(receiver , amount);
- llRegionSayTo(id, 0, msg_success);
- llInstantMessage(receiver, llGetDisplayName(id) + " paid you $" + (string)amount + "L.\n");
- donor = id;
- total += amount;
- llSetText((string)total + " L$", <1.0, 1.0, 1.0>, 1.0);
- }
- else
- {
- llRegionSayTo(id, 0, msg_fail);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement