ok now that my game is done, i need it to pay me a fraction of what it earns, and also someone else.
i also need it to account for when people win.
is this hard to do?
These forums are CLOSED. Please visit the new forums HERE
paying multiple people |
|
Harminoff Hadlee
Registered User
Join date: 13 Jul 2004
Posts: 35
|
07-29-2004 21:08
ok now that my game is done, i need it to pay me a fraction of what it earns, and also someone else.
i also need it to account for when people win. is this hard to do? |
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
07-29-2004 22:06
Here's some code that does it automatically:
CODE
Note that this code will not pay an equal amount to every person if the amount is not evenly divisible by the number of keys in KEYS_TO_PAY. This is a limitation of the integer datatype, which is used to represent funds in Second Life. If the amount is not evenly divisible, the remainder of dividing the amount by the number of keys in KEYS_TO_PAY is left with the owner of the object. To find a person's key, put this script in an object and have the person in question touch the object: CODE
==Chris |
Harminoff Hadlee
Registered User
Join date: 13 Jul 2004
Posts: 35
|
07-29-2004 22:22
so payall is like touchstart? you can have custom ones like that? besides that it looks good.
|
Harminoff Hadlee
Registered User
Join date: 13 Jul 2004
Posts: 35
|
07-29-2004 22:53
ok can i just put it in a state instead?
and if the person wins, they get twice there money back. which the owner would loose more money then the other people in it. so i was thinking that if i have the current earned cash put into a variable, and if it hits 100 then it pays the owner 66 and the other person 34. then resets the variable back to 0. does that seem like a good way to do it? |
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
07-29-2004 23:27
Originally posted by Harminoff Hadlee so payall is like touchstart? you can have custom ones like that? besides that it looks good. Nono, payAll() is like llGiveMoney; you call it like you would an ll function. For example, say you wanted to form a multiperson donation box: CODE
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
07-29-2004 23:36
Originally posted by Harminoff Hadlee ok can i just put it in a state instead? and if the person wins, they get twice there money back. which the owner would loose more money then the other people in it. so i was thinking that if i have the current earned cash put into a variable, and if it hits 100 then it pays the owner 66 and the other person 34. then resets the variable back to 0. does that seem like a good way to do it? payAll was designed to give the money equally... if you wanted to split the money differently, you'd need to first multiply the amount passed to payAll by the percentage you want to give to the other participants. CODE
|
Harminoff Hadlee
Registered User
Join date: 13 Jul 2004
Posts: 35
|
07-29-2004 23:58
ok i see now. one last question, i know that it is set up for like selling stuff, in that if it sells something then it splits the money. that is fine, but sence its a game someone can win, meaning that money will be taken from the owner. so only the owner losses money if someone wins correct? im confussed on how to fix that problem, hence the pot of 100 thing.
|
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
09-11-2004 12:17
when multiplying by a percentage, or just using the payall function normally, does the owner need to specify their key in the key list or are the keys in the key list ADDITIONAL people to pay.
I.E. you specify 3 people in the list with a percentage of 25 for yourself and thus that'd be an even split, or you specify 1 person in the list and 80 percent. So you get 80 percent while the additional 20 percent goes to the key in the list? Did I understand this correctly? |
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
09-14-2004 07:33
Originally posted by Siro Mfume when multiplying by a percentage, or just using the payall function normally, does the owner need to specify their key in the key list or are the keys in the key list ADDITIONAL people to pay. I.E. you specify 3 people in the list with a percentage of 25 for yourself and thus that'd be an even split, or you specify 1 person in the list and 80 percent. So you get 80 percent while the additional 20 percent goes to the key in the list? Did I understand this correctly? payAll pays all people contained in the list KEYS_TO_PAY. If the owner's key is not in this list, the owner isn't paid. In my former snippet, an equal amount of money goes to Jane Doe, John Doe, and Jim Doe, since their keys are in the list. If none of these people are the owner of the object, then the owner gets nothing. In my latter snippet, a certain amount of money is given to the object, and a set percentage of that money is computed and then passed to payAll. THat means a certain percentage stays with the owner. I hope this helps! ==Chris |
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
09-14-2004 11:42
Muchly Chris, thank you.
|
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
|
05-21-2007 07:02
This looks like a great script but I am wondering is it possible to pull the names from a note card? I am looking to use this in a club and would like the percentage payout and the pay to names to be changeable by simple note card.
For example if I wanted Jane Does to get 20% and Jone Doe to get 20% and the rest goes to owner. Can I do this in a configuration note card? One more question can just names be used or is keys the better and only way to pay others? Thanks in advance |
Newgate Ludd
Out of Chesse Error
![]() Join date: 8 Apr 2005
Posts: 2,103
|
05-21-2007 07:41
This looks like a great script but I am wondering is it possible to pull the names from a note card? I am looking to use this in a club and would like the percentage payout and the pay to names to be changeable by simple note card. For example if I wanted Jane Does to get 20% and Jone Doe to get 20% and the rest goes to owner. Can I do this in a configuration note card? One more question can just names be used or is keys the better and only way to pay others? Thanks in advance llGiveMoney requires a Key not a name. You could use an external Key2name database to lookup a name but it is usually simpler to just grab the key of the person you want to pay and paste it directly into the notecard. _____________________
I'm back......
|
Dioxide DeSantis
Registered User
Join date: 2 Feb 2007
Posts: 63
|
05-21-2007 08:02
What code would I place in there to look up the notecard with the configuration of the users to be paid?
I know I must need to remove something from the existing code but being new at scripting I am not sure what comes out and what goes in. I am pretty sure a line something like this must go in there but not sure where CODE
|
Newgate Ludd
Out of Chesse Error
![]() Join date: 8 Apr 2005
Posts: 2,103
|
05-21-2007 11:48
What code would I place in there to look up the notecard with the configuration of the users to be paid? I know I must need to remove something from the existing code but being new at scripting I am not sure what comes out and what goes in. I am pretty sure a line something like this must go in there but not sure where CODE
There si unfortunately far more to it than that I'm afraid. Notecards are not difficult per sae but to use them requires that you understand event driven programming. Try this thread for an example. _____________________
I'm back......
|