almarket23 0 Posted February 5, 2016 Can anyone fix this for me please prontera,150,150,5 script Teleporter 1_M_YOUNGKNIGHT,{ set .n$,"[ Teleporter ]"; mes .n$; mes "Please enter the Floor Number."; mes "==============================="; mes "List of Active Maps"; if(query_sql ("SELECT id, name, level, status FROM npc ", .id$, .name$, .level$, .status$ )){ for (.@i = 0; .@i < getarraysize(.status$); .@i += 1) { if ( "1" == .status$[.@i] ) { mes ""+.name$[.@i]+""; } } } next; input ( .mapList ); if ( .mapList = .level$ ){ goto "S"+.mapList+""; } else if (( .level$ = .mapList ) && ( "0" == .status$ )){ mes .n$; mes "Unable to find the Floor number. Please enter the Active Floors."; close; } S1: warp"prontera",150,155; end; S2: warp"prontera",150,155; end; S3: warp"prontera",150,155; end; S4: warp"prontera",150,155; end; S5: warp"prontera",150,155; end; } When I try to execute this. Here is the error im getting [Warning]: Unexpected type for argument 1. Expected label, got C_STR [Error]: script:goto: not a label [Debug]: Data: string value="S1" [Debug]: Function: goto [Debug]: Source (NPC): Teleporter at prontera (150,150) [Debug]: Data: string value="S1" [Debug]: Source (NPC): Teleporter at prontera (150,150) Thanks Quote Share this post Link to post Share on other sites
0 Lamex 8 Posted February 5, 2016 Strange but debug doesnt send me any error. But ingame NPC have nothing to select. Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted February 5, 2016 prontera,150,150,5 script Teleporter 1_M_YOUNGKNIGHT,{ .n$ = "[ Teleporter ]"; mes .n$; mes "Please enter the Floor Number."; mes "==============================="; mes "List of Active Maps"; if (query_sql("SELECT id, name, level, status FROM npc ", .@id, .@name$, .@level, .@status)) { for (.@i = 0; .@i < getarraysize(.@status); .@i++) { if (.@status[.@i] == 1) { mes .@name$[.@i]; } } } next; input(.@mapList); for (.@i = 0; .@i < getarraysize(.@status); .@i++) { if ( .@mapList == .@level && .@status == 1 ) { switch(select(.@mapList)){ case 1: warp "prontera", 150, 155; break; case 2: warp "prontera", 150, 155; break; case 3: warp "prontera", 150, 155; break; case 4: warp "prontera", 150, 155; break; case 5: warp "prontera", 150, 155; break; default: mes "No Warp Location Specified"; close; } } } mes .n$; mes "Unable to find the Floor number. Please enter the Active Floors."; close; } 1 almarket23 reacted to this Quote Share this post Link to post Share on other sites
0 almarket23 0 Posted February 6, 2016 (edited) @@Dastgir Hi I tried the script but Im getting this error [Warning]: Unexpected type for argument 1. Expected string. [Debug]: Data: variable name='.@mapList' index=0 [Debug]: Function: select [Debug]: Source (NPC): Teleporter at prontera (150,150) and also the only option the this NPC recognize is the first option, even if the status of the other list is already 1 in database Edited February 6, 2016 by almarket23 Quote Share this post Link to post Share on other sites
0 almarket23 0 Posted February 6, 2016 **bump Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted February 7, 2016 the data type of .@mapList should be string type so change all .@mapList into .@mapList$ Quote Share this post Link to post Share on other sites
0 almarket23 0 Posted February 7, 2016 @@Angelmelody Im still getting the same error. Can anyone fix the script for me please. anyone please??? NVM already fixed the script Thanks to @@Dastgir who fixed the script for and also to those who tried on fixing and giving me solution. Thanks alot Quote Share this post Link to post Share on other sites
Can anyone fix this for me please
When I try to execute this. Here is the error im getting
Thanks
Share this post
Link to post
Share on other sites