Jump to content
  • 0

Hello guys, Need HELP about this error script


fallen0519

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

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 by fallen0519
Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  281
  • Reputation:   14
  • Joined:  10/14/13
  • Last Seen:  

i guess you forgot to use TAB on your script  /ok

-	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 by Ares
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

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....><

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

Does it happen everytime? I think that would only occur if the array would be empty.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  10/31/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

I try the following script first, see if it cause the same problem or not. Thanks for helping, get back to you ASAP !!

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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.
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

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~

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   2
  • Joined:  02/15/14
  • Last Seen:  

Bump !! Please anyone could help me please..~~ Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...