Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Is there any way to stop a script, or use llDie(), when owner does not have enough $?

Zigggy Fizgig
Registered User
Join date: 28 Feb 2007
Posts: 6
07-07-2007 16:00
I have a script which needs to use llDie() if the owner of the object does not have enough funds. So far LSL Wiki says you can't do this, i was just wandering if anyone knows of a way, or if it still not possible.
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
07-07-2007 17:33
removed
Zigggy Fizgig
Registered User
Join date: 28 Feb 2007
Posts: 6
07-07-2007 17:42
Stealing money is not my intension, i need to use it in an advertisement sign that is pay-per-click. If someone clicks on the sign and the creator does not have enough money to pay the owner of the sign, then the sign will IM the creator saying not enough funds so your sign has been deleted. And the sign will be deleted.

Here is version 1.0 of the sign system:
http://www.slexchange.com/modules.php?name=Marketplace&file=item&ItemID=288957
Alicia Sautereau
if (!social) hide;
Join date: 20 Feb 2007
Posts: 3,125
07-07-2007 17:50
edited the abouve

why not do a simple check on the amount of money charged(recieved)

if (charged amount < price)
{
llDie();
}

not a coding expert but from what i`ve seen so far from all money taking scripts, this should do the trick, just make sure to refund the money taken if it`s less then the agreed price per click and then kill
Zigggy Fizgig
Registered User
Join date: 28 Feb 2007
Posts: 6
07-07-2007 18:01
i'll try it out, thanks
Zigggy Fizgig
Registered User
Join date: 28 Feb 2007
Posts: 6
07-07-2007 18:11
My head might not be on straight but, how do i check to see if they received the L$?
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-07-2007 20:06
I think you're out of luck. The problem is about the script having insufficient funds to llGiveMoney (rather than the money() event not getting paid as much as it should). The wiki is pretty discouraging on this subject: . Since there's no way for the script itself to know if the owner has any L$s, it can't tell in advance whether it will work, and llGiveMoney() unhelpfully returns no error code when it fails.
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
07-07-2007 22:26
A script cannot read an avatar's L$ balance, nor know when they do not have enough money to complete a transaction.

The usual work-around for this is to require the object's owner to "pay" the object the required amount of money. No money actually moves (money paid to an object is paid to its owner, so the person pays themselves) but SL will not allow a "pay" action to complete unless the payer has enough money. So, if the "money" event is triggered with the appropriate amount, then the payer did and does have that much money. You can then use an llGiveMoney() command in the money event to actually transfer the money to the intended recipient (provided the script has debit permission, of course, which you need to obtain before any part of this process).

However this won't work for the case you're describing because the payer must be physically present and logged in in order to complete the process of issuing a pay command. The only other way to implement this is to have the advertising customers buy "credit", where the money is transferred to a holding alt and paid from there to ad owners; as part of the transference process the amount paid would be added to a database and this database would be checked to establish when credit had run out. However, this is a complex process, and will require substantial trust.
Zigggy Fizgig
Registered User
Join date: 28 Feb 2007
Posts: 6
07-08-2007 10:11
I guess for this to work it's really going to have rely a lot more on the honor system than i had previously thought. I guess one thing i could do is to have something where the sign asks if they received there L$, and after x number of times in a row the response is "no", then the sign deletes itself. But this will still rely heavily on the honor system.