Hey cebols,
just use a simple for-loop to create your menu.
L_CUSTOMHELMS:
set .@minid, 2001;
set .@maxid, 2100;
set .@diff, .@maxid - .@minid;
set .@helm_menu$, "";
for ( set .@i, 0; .@i < .@diff; set .@i, .@i +1 ) {
set .@helmnr, .@helmnr + 1;
set .@helm_menu$, .@helm_menu$+" Helm ["+.@helmnr+"]:";
}
set .selected, select(.@helm_menu$) -1;
set CUST_LOOK_HEAD_TOP, getlook(LOOK_HEAD_TOP);
set .@viewid, .@minid + .selected - 1;
mes "You've selected Helm "+.selected+". You can see the style the next 5 seconds.";
close2;
set CUST_PREVIEWVIEW, 1;
setlook(LOOK_HEAD_TOP, .@viewid);
sleep2 5000;
setlook(LOOK_HEAD_TOP, CUST_LOOK_HEAD_TOP);
set CUST_PREVIEWVIEW, 0;
end;
// To prevent Logout to bypass the "preview"
OnPCLoginEvent:
if (CUST_PREVIEWVIEW == 1) {
setlook(LOOK_HEAD_TOP, CUST_LOOK_HEAD_TOP);
set CUST_PREVIEWVIEW, 0;
}
end;