Wenden Posted February 23, 2017 Posted February 23, 2017 (edited) Hi, pardon my English, I speak Portuguese. I'm facing a possible bug in the "return" function, even setting a value in the variable it always returns the value 0. In case the variable .@erro always returns 0, even though I set 1. Here is the script: callfunc("Transfer",atoi(.transfer$[3]),atoi(.transfer$[4]),atoi(.transfer$[5])); // Calling the function if(.@erro) close; // Function: function script Transfer { if(getarg(0) == 1){ if(zeny < getarg(1)){ .@erro = 1; return .@erro; } set zeny,zeny-getarg(1); return; } if(getarg(0) == 2){ if(#CASHPOINTS < getarg(1)){ .@erro = 1; return .@erro; } set #CASHPOINTS,#CASHPOINTS-getarg(1); return; } if(getarg(0) == 3){ if(countitem(getarg(1)) < getarg(2)){ .@erro = 1; return .@erro; } delitem getarg(1),getarg(2); return; } } Edited February 23, 2017 by Wenden Quote
0 Emistry Posted February 23, 2017 Posted February 23, 2017 .@erro = callfunc("Transfer",atoi(.transfer$[3]),atoi(.transfer$[4]),atoi(.transfer$[5])); // Calling the function if( .@erro ) close; 1 Quote
0 Wenden Posted February 23, 2017 Author Posted February 23, 2017 (edited) @Edit Now I have a problem here, when it returns from the function this appears in the mapserver. If the function is not called nothing appears. Edited February 23, 2017 by Wenden Quote
Question
Wenden
Hi, pardon my English, I speak Portuguese.
I'm facing a possible bug in the "return" function, even setting a value in the variable it always returns the value 0. In case the variable .@erro always returns 0, even though I set 1.
Here is the script:
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.