fallen0519 Posted March 16, 2014 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 52 Reputation: 2 Joined: 02/15/14 Last Seen: May 10, 2017 Share Posted March 16, 2014 (edited) I am currently getting this error:[Warning]: script:getelementofarray: index out of range (-1) [Debug]: Data: variable name='.tmp$' index=0 [Debug]: Source (NPC): dualclientkicker (invisible/not on a map) And here is the script:Sorry but I'm kind of new in eA scripting. I mean I never studied the language. - script dualclientkicker -1,{ OnPCLoadMapEvent: set .@charmap$, strcharinfo(3); query_sql("SELECT FIND_IN_SET('"+.@charmap$+"', '"+.maps$+"');",.@q); if(.@charmap$!=.tmp$[(.@q-1)]) end; set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` = (SELECT `last_ip` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a); if(.@len-1) { for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) { getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])); if(.tmp$[(.@q-1)]==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) { dispbottom "Dual accounts not allowed in HERE."; warp "prontera",156,173; } } } end; OnInit: set .maps$ ,"bat_a01,bat_room,guild_vs3,pvp_y_5-1"; explode(.tmp$,.maps$,",") ; set .lens , getarraysize(.tmp$); for(set .a,0;.a<.lens;set .a,.a+1) setmapflag .tmp$[.a], mf_loadevent; } Edited March 16, 2014 by fallen0519 Quote Link to comment Share on other sites More sharing options...
Aureon Posted March 16, 2014 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 281 Reputation: 14 Joined: 10/14/13 Last Seen: October 9, 2017 Share Posted March 16, 2014 (edited) i guess you forgot to use TAB on your script - script dualclientkicker -1,{ OnPCLoadMapEvent: set .@charmap$, strcharinfo(3); query_sql("SELECT FIND_IN_SET('"+.@charmap$+"', '"+.maps$+"');",.@q); if(.@charmap$!=.tmp$[(.@q-1)]) end; set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` = (SELECT `last_ip` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a); if(.@len-1) { for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) { getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])); if(.tmp$[(.@q-1)]==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) { dispbottom "Dual accounts not allowed in HERE."; warp "prontera",156,173; } } } end; OnInit: set .maps$ ,"bat_a01,bat_room,guild_vs3,pvp_y_5-1"; explode(.tmp$,.maps$,",") ; set .lens , getarraysize(.tmp$); for(set .a,0;.a<.lens;set .a,.a+1) setmapflag .tmp$[.a], mf_loadevent; } Edited March 16, 2014 by Ares Quote Link to comment Share on other sites More sharing options...
fallen0519 Posted March 16, 2014 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 52 Reputation: 2 Joined: 02/15/14 Last Seen: May 10, 2017 Author Share Posted March 16, 2014 Not about tab-ing, I ald did it, must be some other issue... Anyone help me about this please, I don't know how to fix this problem, is the debug things related to the problem occured? Hmm............. Help any pro scripter here....>< Quote Link to comment Share on other sites More sharing options...
sandbox Posted March 16, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 949 Reputation: 174 Joined: 06/12/12 Last Seen: Friday at 12:25 PM Share Posted March 16, 2014 Does it happen everytime? I think that would only occur if the array would be empty. Quote Link to comment Share on other sites More sharing options...
fallen0519 Posted March 16, 2014 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 52 Reputation: 2 Joined: 02/15/14 Last Seen: May 10, 2017 Author Share Posted March 16, 2014 Whenever I use a command like go back to Prontera city, it keep appearing. Example: @go 0 ...Putty will appear again. Have no idea how to fix it. Please help me sir. =x Quote Link to comment Share on other sites More sharing options...
Phenomena Posted March 16, 2014 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 94 Reputation: 4 Joined: 10/31/12 Last Seen: February 13, 2022 Share Posted March 16, 2014 try use this: - script dualclientkicker -1,{ OnPCLoadMapEvent: set .@charmap$, strcharinfo(3); query_sql("SELECT FIND_IN_SET('"+.@charmap$+"', '"+.maps$+"');",.@q); if(.@charmap$!=.tmp$[(.@q-1)]) end; set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` = (SELECT `last_ip` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a); if(.@len-1) { for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) { getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])); if(.tmp$[(.@q-1)]==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) { dispbottom "Duel accounts not allowed in WOE."; warp "geffen",0,0; } } } end; OnInit: set .maps$ , "aldeg_cas01,gefg_cas01,payg_cas01,prtg_cas01"; explode( .tmp$ , .maps$, ",") ; set .lens , getarraysize(.tmp$) ; for(set .a,0;.a<.lens;set .a,.a+1) setmapflag .tmp$[.a], mf_loadevent ; } original there Quote Link to comment Share on other sites More sharing options...
fallen0519 Posted March 16, 2014 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 52 Reputation: 2 Joined: 02/15/14 Last Seen: May 10, 2017 Author Share Posted March 16, 2014 I try the following script first, see if it cause the same problem or not. Thanks for helping, get back to you ASAP !! Quote Link to comment Share on other sites More sharing options...
Emistry Posted March 16, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted March 16, 2014 probably here query_sql("SELECT FIND_IN_SET('"+.@charmap$+"', '"+.maps$+"');",.@q); if(.@charmap$!=.tmp$[(.@q-1)]) end; you can try something like this .maps$ = "aldeg_cas01|gefg_cas01|payg_cas01|prtg_cas01"; if( compare( "|"+.maps$+"|","|"+strcharinfo(3)+"|" ) ){ // check dual here. } Quote Link to comment Share on other sites More sharing options...
fallen0519 Posted March 16, 2014 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 52 Reputation: 2 Joined: 02/15/14 Last Seen: May 10, 2017 Author Share Posted March 16, 2014 Sir Emistry, can I have the full script please, I afraid that I make some tiny mistake and cause it error again. Is it replace them or something? hmmmmm.... much appreciated~ Quote Link to comment Share on other sites More sharing options...
fallen0519 Posted March 18, 2014 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 52 Reputation: 2 Joined: 02/15/14 Last Seen: May 10, 2017 Author Share Posted March 18, 2014 Bump !! Please anyone could help me please..~~ Thanks Quote Link to comment Share on other sites More sharing options...
Question
fallen0519
I am currently getting this error:
[Warning]: script:getelementofarray: index out of range (-1)
And here is the script:
Edited by fallen0519Sorry but I'm kind of new in eA scripting. I mean I never studied the language.
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.