Jump to content
  • 0

callfunc doubt


Dynasty

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  151
  • Reputation:   5
  • Joined:  11/09/12
  • Last Seen:  

Hello again -w-

 

i have a doubt about callfunc + array var...

 

i know if i do i callfunc + normal var i have to use getarg but.. if is array var how can i do it?

 

cuz when i do like this:

 

case 1:
mes "Silver Arrow";
setarray .@idd,.@id[0];
setarray .@delitem[0],1011,912,2557,2333;
mes "Zargon 10 silver arrow";
mes "Emveretarcon 100 silver arrow";
mes "Unicorn Horn 1000 silver arrow";
mes "Silver Robe 10000 silver arrow";
set .@menu,select(.@menu2$);
set .@opt,.@menu-1;
set .@delitemm,.@delitem[.@opt];
callfunc "arrowmaker1",.@idd,.@delitemm,.@opt;
end;

+

function script arrowmaker1 {
//getarg(0) = .@idd || getarg(1) = .@delitem || getarg(3) = .@opt
set .@opt,getarg(2);
set .@idd[0],getarg(0);
set .@delitemm[0],getarg(1);

the array part only show me the first value :S


bumm

Edited by Dynasty
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

You mean this?

for ( .@i = 0; .@i < getargcount(); .@i++ )
     mes getarg(.@i);
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  151
  • Reputation:   5
  • Joined:  11/09/12
  • Last Seen:  

no, i mean a getarg of a array var .-.

 

get all values of a array in a function

 

something like this

mes "";
setarray .@item[0],100,100,100;
callfunc "tara",.@item;

function tara {

setarray .@item[0],getarg(0);

close;

forget it -w- i used getelementofarrray(getarg(0),1) like this

setarray .@item[0],100,100,100
callfunc "tara",.@item;
close;

function tara (

setarray .@item[0],getelementofarrray(getarg(0),0),getelementofarrray(getarg(0),1),getelementofarrray(getarg(0),2);
close;
}
Edited by Dynasty
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...