| $NextListItem(List Name[, start item name[, doLoop]])
The NextListItem function will step through the list with the name of List Name to
find the next item in it. If you specify a start item name, it will begin with that item.
doLoop is by default on, and it will loop back to the beginning of the list when it
reaches the end. You may turn off doLoop by specifying '0' or 'false'. This function
returns the item name, not the value.
Example:
| $NextListItem() example |
# Setup our example list
list testlist { one 1; two 2; three 3; };
# On join, set the player char key to the first item on a_serverjoin cmd testchar = "one";
# And on the player command test, loop through the list on pcmd_test cmd { testchar = "$NextListItem(testlist,$p@testchar)"; /say_resp * Now on $p@testchar; };
|
|
|