Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

money_start() and money_end()

Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
04-27-2006 13:02
A simple but VERY useful feature that has occurred to me as a result of the fast-pay "exploit" in the scripting tips forum.

Anyway, the main problem with multi-user vendors is that it's difficult to stop users from changing the item while someone is paying, as you don't know who is paying the vendor! So you have to lock it and just hope it doesn't mess things up for everyone too badly, or not bother at all.

These two events however would help greatly, and would be very useful:

money_start(integer number_paying);

This event is triggered when somebody chooses to "Pay" the item (right-click > Pay), it passes in the number of avatars currently "Paying" the vendor (ie who have not click 'Pay', or who have not closed the pay dialogue themselves or by being logged out).
When this event is triggered a scripter could happily add them to a list of payees and give them a time in which to pay up or be removed from the list.

money_end(key id, integer number_paying);

Same as above but it is triggered when someone closes the pay dialogue, or pays the vendor (triggered AFTER the money() event). This gives the key (id) of the user who has finished, and the number still paying the vendor.

For both events, the llDetected* functions would return the usual results that touch_start() etc. have available.


Has this been suggested already (if so, whereabouts?), if not, it's a relatively simple addition which would greatly help vendors function more intuitively in busy areas =)
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
04-28-2006 21:39
your money_end event is pretty much the same the as the money event. I'm not clear on how a start and end would work. When a person pays you know who(UUID) is paying and how much they are paying. if there is an exploit report it as a bug. or it just might be bad coding on the programmers end. Always make sure the price they pay matches the object they are buying if not return their money.
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
04-29-2006 02:25
It's not the exploit I'm trying to fix, the 'exploit' was just bad scripting. But this would make multi-user vendors much easier to code since you can actually detect when someone is paying the vendor (rather than just assuming that the last person to touch your vendor is going to pay it).

The money end is really to let you know when someone closes the pay dialogue without paying, but also allows you to perform the same (ie tidying up) action for a money() event by triggering it then. Though the entire money_end() event is really optional, it's money_start() that is the most useful and likely the easiest to implement as well, since the server is already contacted when the pay dialogue is opened (ie to get the pay values to display, iirc), so having it trigger a script event as well wouldn't be much of an extra step.