Jump to content

tip jar,not for the owner help


Proto99
 Share

You are about to reply to a thread that has been inactive for 2982 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

i try to make a tip jar,but it keep give the money to the owner of the tip jar.,

i can get the id from the one tiped,

money(key id, integer amount)
    {
        Total += amount;
        string str = (string) [Loginname, "'s Tip Jar.\nL$", amount," Was Donated last!\nL$", Total, " Donated so far" ]; 
        llSetText(str, <1,1,1>, 1);
        llInstantMessage(id,"Thanks for the tip!");
        llInstantMessage(id, llKey2Name(id) + " donated L$" + (string) amount );

 as i owne the tip jar the tip will all get to me.

Link to comment
Share on other sites

That's what it's supposed to do.  When you give money to an object, it always goes to the owner of the object.  if you want to then send it to someone else, you will need to add llRequestPermissions and a run_time_permissions event in which you use llTransferLindenDollars to send the L$ somewhere else.

Link to comment
Share on other sites

Now it asking permision to the owner if bob can tip julie...still not work..

    money(key id, integer amount)
    {
        Total += amount;
        string str = (string) [Loginname, "'s Tip Jar.\nL$", amount," Was Donated last!\nL$", Total, " Donated so far" ];
        llRequestPermissions(llDetectedKey(0),PERMISSION_DEBIT);
        llSetText(str, <1,1,1>, 1);
        llInstantMessage(id,"Thanks for the tip!");
        llInstantMessage(id, llKey2Name(id) + " donated L$" + (string) amount );
    }
    run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_DEBIT)
        {
            llTransferLindenDollars(tid, amount);
            llWhisper(0,"Thanks for the tip!");
        }
    }
}
Link to comment
Share on other sites


Proto99 wrote:

Now it asking permision to the owner if bob can tip julie...still not work.. [ .... ]

Of course not.  You've put the llRequestPermissions statement in the money event. You're not supposed to be requesting permission to debit the account of the person who just donated to the tip jar.  You need to request permission from the owner of the tip jar (YOU) to debit the owner's account, so it can send the tip to someone else. You only need to get that permission once, when the script is set up (or when it's restarted).  After that, it will always have permission to send tips from you to whoever you designate (your target named tid).

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2982 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...