|
duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
|
12-05-2007 08:12
mmk, Im new at this and have been scouting for simple scripts to play around with so I can get the feel for 'em. The below script was copied from http://e-pec.info/forum/lofiversion/index.php/t3622.html I thought it was a neat idea to have a multifaceted tip jar, but that's out of my league for the moment. Instead I wanted to start with the below. There is an error where indicated and it reads, "(9, 66) : ERROR : Function call mismatches type or number of arguments" :\ From: someone key tiprecipient; integer donations;
default { state_entry() { tiprecipient = llGetOwner(); llRequestPermissions(llGetOwner(),PERMISSION_DEBIT); llSetText("Donations collected so far: \n L$" + (string) donations); <--ERROR HERE }
money(key id, integer amount) { llGiveMoney(tiprecipient,amount); llSay(0,"Thank you " + llKey2Name(id) + " for your kind donation <3"); donations = donations + amount; } }
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-05-2007 08:32
It's complaining because llSetText wants to be told the color to display the text in and how transparent it should be.. See http://wiki.secondlife.com/wiki/LlSetText . Since you don't seem to be redistributing the money to somebody other than the owner, you don't need to request debit permissions or use llGiveMoney. Maybe something like this would do instead... integer donations = 0;
UpdateText() { llSetText ("Donations collected so far: \n L$" + (string)donations, <1.0, 1.0, 1.0>, 1.0); }
default { state_entry() { UpdateText(); }
money(key id, integer amount) { llSay(0,"Thank you " + llKey2Name(id) + " for your kind donation <3"); donations += amount; UpdateText(); } }
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
duLuna Bosatsu
OMnomnom nom.
Join date: 4 Nov 2007
Posts: 102
|
12-05-2007 08:50
Thankyou, Meade! Only problem now is getting the option "pay" to show up... From: someone default { state_entry() { llOwnerSay("Loaded and ready to go!"  ; } money( key id, integer payment ) { llInstantMessage(id, "Thank you for paying me " + (string)payment + "L!"  ; } I'm using that on another beta prim, and it works fine... comparing the script I had/the one you gave me there really is no reason why the pay shouldn't show up.. I'm guessing it might have to do with the commands above "default", however that seems like a tricky thing to be without :\
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-05-2007 09:01
Add this to state_entry...
llSetPayPrice(PAY_HIDE, [25, 50, 100, 250000]);
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|