help with llGiveMoney
|
|
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
|
05-11-2006 21:40
I have this script which does well to request permission from the owner and then give the target $L1, which is me. So paying myself 1 dollar doesnt do much.
In the situation I'm developing this for, the object will be owned by other avatars. So, how can I change this script so that the target of the money is someone other than the owner?
touch_start(integer total_number) { llRequestPermissions(llGetOwner(),PERMISSION_DEBIT); llGiveMoney(llDetectedKey(0),1); }
|
|
Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
|
05-11-2006 22:17
ok . . . first thing . . . the llRequestPermissions aught to be made in the state_entry event as I don't think that script execution is paused while the owner waits to say yes. Secondly from what I see the script will give one linden to anyone who touches the prim. So I don't understand your question. (I'm assuming you are touching it to test, have someone else touch  )
|
|
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
|
05-12-2006 00:38
I am actually trying to get it to work the other way. When someone touches the prim, it will take L$ *from* them and give it to me.
Sorry if I was confusing about what I meant. how can I make this happen?
|
|
Guido Columbia
Registered User
Join date: 25 Oct 2005
Posts: 102
|
05-12-2006 00:44
From: Geuis Dassin I am actually trying to get it to work the other way. When someone touches the prim, it will take L$ *from* them and give it to me.
Sorry if I was confusing about what I meant. how can I make this happen? Impossible to do it. An object can only request debit permissions from it's owner.
|
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
05-12-2006 00:46
Basically - You can't
If you want someone to give you money they have to use pay/buy to give you or the object money.
llGiveMoney always takes money from the script OWNER, as far as I am aware there is no way to get it to take money from someone else ( even if they give permission )
Which if you think about it is quite sensible -
I ask your permission to take money - you say yes - I take your whole balance - not good.
|
|
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
|
05-12-2006 06:51
Ok, Im not sure why no one understands this question.
I am making Object A which has a llGiveMoney script in it.
Someone else is given/buys Object A and becomes the owner.
When Object A is activated, it will do PERMISSION_DEBIT on the owner, and when permission is given it will send L$ 1 to me.
My question is how to make the script direct to me remotely.
|
|
Gigs Taggart
The Invisible Hand
Join date: 12 Feb 2006
Posts: 406
|
05-12-2006 07:08
Ah, easy, just hard code your avatar's key into the givemoney call.
Try doing llOwnerSay((string)llDetectedKey(0)); in a touch event to get your key, then put that string (in quotes) in the call.
|
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
05-12-2006 11:20
integer amount = 1;
llGiveMoney( llGetCreator(),amount );
As long as you are the creator of the object you have given them
|
|
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
|
05-12-2006 12:25
I was thinking about using the creator. Im glad you mentioned it.
One thought of terror that flashed through my mind was someone being able to change the creator of my object, or otherwise modify my script.
I would not be happy to see that someone figured out how to take money *from* my account, instead of them paying into it.
Is there a known way to hack a prim w/ a set script? to change the creator or anything like that? I have to develop this project very carefully.
|
|
Charles Granville
Registered User
Join date: 18 Mar 2006
Posts: 33
|
05-12-2006 12:35
Not that I am aware of. Just to be safe, in 'state_entry', you could add: if (llGetCreator() != 'your key') llDie();
And, as I would assume you planned to do, don't give anyone modify permissions but yourself. Otherwise, the entire thing is pointless. 
|
|
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
|
05-12-2006 13:45
Once you sell/give away an object, if you update the script on your original copy of the object does it update on the duplicates as well? If not, is there a way to do this?
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
05-12-2006 21:09
From: Geuis Dassin Once you sell/give away an object, if you update the script on your original copy of the object does it update on the duplicates as well? No.  From: Geuis Dassin If not, is there a way to do this? Yes. ...but don`t ask me! Ask the people involved in the llRemoteLoadScriptPin thread. Toodle-oo!
|
|
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
|
05-12-2006 23:59
From: Charles Granville Not that I am aware of. Just to be safe, in 'state_entry', you could add: if (llGetCreator() != 'your key') llDie();
I use a slightly less destructive piece of code product_check() { if ( llKey2Name(lGetCreator()) != "Adriana Caligari" ) { if ( TRUE ) {state violation} } } .. .. .. state violation { state entry() { llSay ( 0,"This product has been altered - it will no longer work - the original creator has been informed" ); llEmail( "mymail" ,"VIOLATION",llKey2Name( llGetOwner()) + "(" + (string)llGetOwner() + ")" + llGetRegionName() + (string)llGetRootPosition() + "--" + product_name + (string)llGetTimestamp() ); } on_rez( integer r ) { product_check(); } changed( integer c ) { if ( c && CHANGED_OWNER ) { product_check(); } } }
Or things to that effect - not a die - just tell them that it has stopped working - why - and informs me by email of when, where and who. Everytime it is rezzed it goes thru the product check first ( as well as with owner change ) - so unless my name is the creator it is a very useless object.
|
|
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
|
05-13-2006 05:18
From: Adriana Caligari I use a slightly less destructive piece of code product_check() { if ( llKey2Name(lGetCreator()) != "Adriana Caligari" ) { if ( TRUE ) {state violation} } }
... Doesn't llKey2Name() work only if you happen to be in the same sim? That's what the Wiki says anyway... makes it sound like that code would generate violation in any case you aren't present around o.O
|
|
Jonn Soothsayer
Registered User
Join date: 21 Oct 2005
Posts: 8
|
05-13-2006 11:57
yea you would either have to have it check against your key or use llRequestAgentData(llGetCreator(), DATA_NAME) and a dataserver event
|