Hi,
I'm trying to make a script that erases a fixed set of variables. When I do it one by one like this:
prontera,156,174,4 script Reset 752,{
mes "La variable Z es igual a:";
mes $Z;
mes "Resetear variable Z a:";
input $Z;
next;
mes "La variable rossata es igual a:";
mes $rossata;
mes "Resetear variable rossata a:";
input $rossata;
next;
mes "La variable dullahan es igual a:";
mes $dullahan;
mes "Resetear variable dullahan a:";
input $dullahan;
next;
mes "La variable cachorro es igual a:";
mes $cachorro;
mes "Resetear variable cachorro a:";
input $cachorro;
next;
mes "La variable $teo es igual a:";
mes $teo;
mes "Resetear variable $teo a:";
input $teo;
close2;
end;
}
It works fine. I input the values, and they stay that way.
But when I try to use arrays, like this:
prontera,156,174,4 script Reset 752,{
setarray .@resetnam$[0],"recluta","$Z","$rossata","$dullahan","$cachorro","$teo";
setarray .@reset[0],recluta,$Z,$rossata,$dullahan,$cachorro,$teo;
cleararray .@reset[0],0,(getarraysize(.@resetnam$[0]));
mes "Estado de las variables:";
for (.@i=0; .@i < (getarraysize(.@resetnam$[0])); .@i=.@i+1) {
mes .@resetnam$[.@i]+" = "+.@reset[.@i];
}
close;
}//end script
... the message window in the client shows me that all the values are now 0, but they really are not because when I close the "Reset" NPC and check the values on another NPC, they're back to the value they had before I used the "Reset" NPC.
Any help to make the array changes work?
Thanks in advance.