Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer price = 10;
- integer price1 = 20;
- integer price2 = 40;
- integer price3 = 50;
- integer counter;
- default
- {
- state_entry()
- {
- llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
- llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
- }
- run_time_permissions(integer perm)
- {
- if(perm & PERMISSION_DEBIT)
- state cash;
- }
- }
- state cash
- {
- state_entry()
- {
- llSetText("Parking Meter
- 10L$ = 30 Min
- 20L$ = 1 Hour
- 40L$ = 3 Hour
- 50L$ = 5 Hour
- ", <1.0,1.0,1.0>, 1.4);
- llSetPayPrice(PAY_HIDE, [price ,price1, price2, price3]);
- }
- money(key id, integer amount)
- {
- if(amount == price){
- llInstantMessage(id, "Paid: "+ (string)price);
- llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
- counter = 0;
- llSetTimerEvent(5);
- }
- else if(amount == price1){
- llInstantMessage(id, "Paid: "+ (string)price1);
- llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
- counter = 0;
- llSetTimerEvent(10);
- }
- else if(amount == price2){
- llInstantMessage(id, "Paid: "+ (string)price2);
- llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
- counter = 0;
- llSetTimerEvent(15);
- }
- else if(amount == price3){
- llInstantMessage(id, "Paid: "+ (string)price3);
- llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
- counter = 0;
- llSetTimerEvent(20);
- }
- }
- timer()
- {
- //price
- --counter;
- if(counter <= 0)
- {
- llSay(0,"over");
- llSetTimerEvent(0);
- counter = 0;
- llSetPayPrice(PAY_HIDE, [price ,price1, price2, price3]);
- llSetText("Time Left: "+ (string)counter, <1.0,1.0,1.0>, 1);
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement