Jump to content
  • 0

Not Entering For Loop


Question

Posted (edited)

I'm trying to add/check the player ip into an array,
but my script is not behaving as it is intended.

The issue here is that, its not running the for loop,
tried to add some debug messages to make sure of it.

OnInit:
	setarray .@iparr$[0],"null";
end;

OnPCLoginEvent:

	query_sql("SELECT `last_ip` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",@pip$);

	set .@arrsize,getarraysize(.@iparr$);
	for(set .@i,0; .@i < .@arrsize; set .@i,.@i+1) {
		//do things
		// for debugging purposes
		dispbottom "index "+.@i+" with value of "+@pip$+"";
	}
		// for debugging purposes
		dispbottom "pc login loop done";
end;

Someone please check this for me,
this is kind of frustrating, (i always was)

Is it because of my variable types? ( i dont think so)
Is this a Bug or something else?

Edited:
found out that the getarraysize() function has something to do with this,
i'm not sure why, ill just find other way, instead of using getarraysize().

Edited by benching

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...