Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   checking arrays. (https://forums.graalonline.com/forums/showthread.php?t=33827)

joseyisleet 07-19-2002 03:59 PM

checking arrays.
 
Aloha, how would i check if a array is at it's max like if i specify the max of it and it reaches that and it does something how would i do it, and how would i show it in showimg?, thanks anyone who can help.
- Chicken AKA Howard

GrowlZ1010 07-19-2002 04:51 PM

To find out the size (what I presume you mean by 'maximum') of an array, use the arraylen(var) function. This will return the number of individual slots inside the array itself. So to do something when a variable reaches the length of your array:

NPC Code:

if (yourvariable=arraylen(yourarray)){
// do stuff
}


joseyisleet 07-19-2002 04:57 PM

yay
 
Thanks :) i appreciate that alot :), how would i show an array in a message or some if possible.
-Chicken AKA Howard

screen_name 07-19-2002 08:27 PM

well, you could use a loop

NPC Code:

for (this.i=0;this.i<arraylen(myarray);this.i++) {
showimg this.i+1000,@#v(myarray[this.i]),5,80+(this.i*10);
changeimgzoom this.i+1000,.7;
changeimgvix this.i+1000,4;
}


joseyisleet 07-20-2002 08:10 AM

oo
 
ok kool thanks :), i got it now :).


All times are GMT +2. The time now is 09:17 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.