Wenden Posted February 23, 2017 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 4 Reputation: 1 Joined: 11/29/16 Last Seen: March 13, 2017 Share 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 Link to comment Share on other sites More sharing options...
0 Emistry Posted February 23, 2017 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Thursday at 04:49 PM Share Posted February 23, 2017 .@erro = callfunc("Transfer",atoi(.transfer$[3]),atoi(.transfer$[4]),atoi(.transfer$[5])); // Calling the function if( .@erro ) close; 1 Quote Link to comment Share on other sites More sharing options...
0 Wenden Posted February 23, 2017 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 4 Reputation: 1 Joined: 11/29/16 Last Seen: March 13, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
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:
Link to comment
Share on other sites
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.