SCRIPT ERROR (MULTI CURRENCY SHOP)

MikZ

New member
Messages
461
Points
0
Good day ! I'm getting this error. kindly help we how to solve this. thanks!

Code:
[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$;
 
[No message]
 
.@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$

 
Last edited by a moderator:
Solved! Emistry Currenshop! thanks @meko

Code:
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$;
 
Last edited by a moderator:
Back
Top