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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

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