Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer price = 10;
  2. integer price1 = 20;
  3. integer price2 = 40;
  4. integer price3 = 50;
  5.  
  6. integer counter;
  7.  
  8.  
  9. default
  10. {
  11.     state_entry()
  12.     {
  13.         llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
  14.         llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
  15.     }
  16.     run_time_permissions(integer perm)
  17.     {
  18.         if(perm & PERMISSION_DEBIT)
  19.             state cash;
  20.     }
  21. }
  22.  
  23. state cash
  24. {
  25.     state_entry()
  26.     {
  27.         llSetText("Parking Meter
  28. 10L$ = 30 Min
  29. 20L$ = 1 Hour
  30. 40L$ = 3 Hour
  31. 50L$ = 5 Hour
  32.                   ", <1.0,1.0,1.0>, 1.4);
  33.         llSetPayPrice(PAY_HIDE, [price ,price1, price2, price3]);
  34.     }
  35.     money(key id, integer amount)
  36.     {
  37.        
  38.         if(amount == price){
  39.             llInstantMessage(id, "Paid: "+ (string)price);
  40.             llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
  41.             counter = 0;
  42.             llSetTimerEvent(5);
  43.         }
  44.       else if(amount == price1){
  45.             llInstantMessage(id, "Paid: "+ (string)price1);
  46.              llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
  47.              counter = 0;
  48.              llSetTimerEvent(10);
  49.             }
  50.       else if(amount == price2){
  51.             llInstantMessage(id, "Paid: "+ (string)price2);
  52.              llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
  53.              counter = 0;
  54.               llSetTimerEvent(15);
  55.             }
  56.       else if(amount == price3){
  57.             llInstantMessage(id, "Paid: "+ (string)price3);
  58.              llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
  59.              counter = 0;
  60.               llSetTimerEvent(20);
  61.             }
  62.         }
  63.        
  64.             timer()
  65.             {
  66.                 //price
  67.                
  68.                 --counter;
  69.                
  70.                 if(counter <= 0)
  71.                 {
  72.                     llSay(0,"over");
  73.                     llSetTimerEvent(0);
  74.                     counter = 0;
  75.                      llSetPayPrice(PAY_HIDE, [price ,price1, price2, price3]);
  76.                      llSetText("Time Left: "+ (string)counter, <1.0,1.0,1.0>, 1);
  77.             }
  78.            
  79.     }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement