Jump to content

llSetPayPrice and variables, can't get it to work.

Azziej Enzo

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

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

Recommended Posts

Heya everybody,

I am trying to figure out why i can't put notecard read prices into a llSetPayPrice function.

For some reason it did work once, i saw the numbers that i gave up in the notecard and after i payed it to test it out, the prices dissapeared and shows again an empty pay box. Whatever i try it just does not want to recognise the variables.

Here is what i got, help would be greatly appreciated. (Script is truncated to show only that which might be causing the problem)

Note: The script compiles succesfully and works, except for the llSetPayPrice part.


Thank in advance! :)



money(key id, integer amount)
// This line is not showing the PayAmount as declared.
 llSetPayPrice(PAY_DEFAULT, [PayAmount1,PayAmount2,PayAmount3,PayAmount4]);

 // Debug line, shows all four PayAmount's so they are set. am i correct??
 llSetText(PayAmount1 + PayAmount2 + PayAmount3 + PayAmount4,<1,1,1>,1)




Link to comment
Share on other sites

Two things.  First, I'd normally put llSetPayPrice  somewhere other than the money event, since the money event is only going to happen (thus causing llSetPayPrice to be executed in your example) after money is paid to the object.   And you presumably want the prices visible before people try to pay.

Second, by declaring  (integer)PayAmount1; and so on inside the money event, you're in effect wiping whatever value they had before.   So the code as you have it there can't work because the script doesn't know what integer(PayAmount1) is, so it's defaulting it to 0.

Without seeing your whole script it's difficult to be sure, but I think, from what you say, I'd set llPayPrice inside the dataserver event, when i've finished reading the notecard and know what those integers are.



Link to comment
Share on other sites

well for starters, setting the pay values in the money event is a bad idea.... since the money event is triggered AFTER someone pays



does nothing on a line by itself,... you cannot change the type of a variable permanently like this, it only changes for that line, but you don't do anything with it.

instead you need to do that inside of the set pay price call such as

llSetPayPrice( PAY_DEFAULT, [(integer)PayAmount1, (integer)PayAmount2, (integer)PayAmount3, (integer)PayAmount4] );


and beat to the punch by Innula, gj =)

Link to comment
Share on other sites

Thank you both for your reply.

i didn't know the money event was only triggered after payment. just like the (integer)PayAmount conversion from string on one line, thought it meant it converted it for the event in which it is contained.

I got it to work indeed by putting llSetPayPrice into the dataserver event and puttin the (integer) conversion in the same line. It also updates correctly when changed in the notecard.

Thank you both again so much!!...


Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...