//===== rAthena Script ======================================= //= Sample: inarray //===== By: ================================================== //= rAthena Dev Team //===== Last Updated: ======================================== //= 20180424 //===== Description: ========================================= //= Demonstrates the 'inarray' and 'countinarray' commands. //============================================================ prontera,160,190,3 script inarray sample 847,{ switch(select("inarray:countinarray")){ case 1: //inarray command test mes "[inarray Test]"; setarray .@array1[0],100,200,300,400,500,600,700; setarray .@array2$[0],"One Hundred","Two Hundred","Three Hundred","Four Hundred","Five Hundred","Six Hundred","Seven Hundred"; mes .@array2$[inarray(.@array1,100)]; //return One Hundred mes .@array2$[inarray(.@array1,300)]; //return Three Hundred //mes .@array2$[inarray(.@array1,800)]; //this will return with an error //800 is not an element of the array .@array1 mes "" + inarray(.@array1,800); //this return -1 //800 is not an element of the array .@array1 close; case 2: //countinarray command test switch(select("Basic:Advanced")){ case 1: mes "[countinarray Basic Test]"; setarray .@array$[0],"rathena","ragnarok","poring","script"; mes "the array elements: "; for(.@i=0;.@i