Jump to content
  • 0
MikZ

SCRIPT ERROR (MULTI CURRENCY SHOP)

Question

Good day ! I'm getting this error. kindly help we how to solve this. thanks!

[Warning]: script error in file 'npc/custom/FRO/NPC/costumerental.txt' line 125 column 39
    This command is deprecated and it will be removed in a future update. Please see the script documentation for an alternative.

   122:         if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
   123:         set .@l, getstrlen(""+.@num);
   124:         for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
*  125:                 set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   126:                         if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
   127:         }
   128:         return .@num$;

 

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
.@num$ = .@num % (10 ** (.@i + 1)) / (10 ** .@i) + .@num$;

// x = (y mod (10 ** (z + 1)) / (10 ** z))
// x = y mod 10

// this means it can be simplified to:
.@num$ = (.@num % 10) + .@num$;

but I believe your original script had an error because it uses both .@num and .@num$

Share this post


Link to post
Share on other sites
  • 0

Solved! Emistry Currenshop! thanks @meko

function	ValueConvert	{
	set .@num, atoi(""+getarg(0));
	if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
	set .@l, getstrlen(""+.@num);
	for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
		set .@num$, .@num % (10 ** (.@i + 1)) / (10 ** .@i) + .@num$;
			if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
	}
	return .@num$;

 

Edited by MikZ

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.