Lord Ganja Posted May 8, 2015 Share Posted May 8, 2015 (edited) Hi. Im using this dynamic menu for my custom enchantment. But it seems getting debugs whenever it runs into this script. I can't seem to figure out whats the problem. mes .npc$; mes "Please select an equipment from the menu."; next; while(set([email protected],[email protected]+1)<=.e_len) { if(getequipid([email protected])>-1) { if(getiteminfo(getequipid([email protected]),2)!=4) { set [email protected]$, [email protected]$+.eqp$[[email protected]]+"- [^0000FF"+getitemname(getequipid([email protected]))+"^000000]:"; set([email protected][getarraysize([email protected])],[email protected]); } } } OnInit: setarray .eqp$, "Upper Headgear", "Armor", "Left Hand", "Right Hand", "Garment","Shoes", "Accessory1", "Accessory2", "Mid Headgear", "Low Headgear"; set .e_len , getarraysize(.eqp$); Debugs: [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) [Debug]: Source (NPC): Ganja Runes#1 at turbo_room (76,110) Edited May 8, 2015 by Lord Ganja Quote Link to comment Share on other sites More sharing options...
Brian Posted May 11, 2015 Share Posted May 11, 2015 if (getequipid([email protected]) > -1) { For checking if they have an item equipped in that slot, you should use getequipisequiped. Even though 'getequipid' returns -1 if no item is equipped, that is considered a failure of the script command and that's why the map-server shows the debug message. Quote Link to comment Share on other sites More sharing options...
ocelote Posted May 8, 2015 Share Posted May 8, 2015 set [email protected]$, ""; for(set [email protected],0; [email protected] < getarraysize(.eqp$); set [email protected], [email protected] +1){ if(.eqp$[[email protected]] != "") { set [email protected]$, [email protected]$ + "- [^0000FF"+getitemname(getequipid([email protected]))+"^000000]"; set [email protected]$, [email protected]$ + ":"; } } set @selected,select([email protected]$)-1; Quote Link to comment Share on other sites More sharing options...
Lord Ganja Posted May 8, 2015 Author Share Posted May 8, 2015 set [email protected]$, ""; for(set [email protected],0; [email protected] < getarraysize(.eqp$); set [email protected], [email protected] +1){ if(.eqp$[[email protected]] != "") { set [email protected]$, [email protected]$ + "- [^0000FF"+getitemname(getequipid([email protected]))+"^000000]"; set [email protected]$, [email protected]$ + ":"; } } set @selected,select([email protected]$)-1; I forgot to mention. Weapons are excluded. It shouldn't put weapons on the menu if weapon is equipped. How would I do that? Quote Link to comment Share on other sites More sharing options...
ocelote Posted May 8, 2015 Share Posted May 8, 2015 set [email protected]$, ""; for(set [email protected],0; [email protected] < getarraysize(.eqp$); set [email protected], [email protected] +1){ if(.eqp$[[email protected]] != "") { set [email protected]$, [email protected]$ + "- [^0000FF"+getitemname(getequipid([email protected]))+"^000000]"; set [email protected]$, [email protected]$ + ":"; } } set @selected,select([email protected]$)-1; I forgot to mention. Weapons are excluded. It shouldn't put weapons on the menu if weapon is equipped. How would I do that? Oh, sorry i don't know you can add check if (getequipisequiped(EQI_HAND_L)) {mes "uneqip weapon first"; close;} Quote Link to comment Share on other sites More sharing options...
Lord Ganja Posted May 8, 2015 Author Share Posted May 8, 2015 I tried this script for it exclude weapons, but im having debugs and i don't know why if( getiteminfo(getequipid([email protected]),2) == 4 ) Quote Link to comment Share on other sites More sharing options...
Lord Ganja Posted May 11, 2015 Author Share Posted May 11, 2015 (edited) if (getequipid([email protected]) > -1) { For checking if they have an item equipped in that slot, you should use getequipisequiped. Even though 'getequipid' returns -1 if no item is equipped, that is considered a failure of the script command and that's why the map-server shows the debug message. What should I use so it won't display weapons on the menu, even if a weapon is equipped? EDIT: Nvmind, figured it out. Thanks for your help Edited May 11, 2015 by Lord Ganja Quote Link to comment Share on other sites More sharing options...
Hi. Im using this dynamic menu for my custom enchantment. But it seems getting debugs whenever it runs into this script. I can't seem to figure out whats the problem.
Debugs:
Edited by Lord GanjaLink to comment
Share on other sites