Jump to content
  • 0

Query Limit Help


nasagnilac

Question


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

OnCheck:
		deletearray .@acc[0], getarraysize(.@acc); deletearray .@char[0], getarraysize(.@char);
	for(set .@i,0; .@i<=25; set .@i,.@i+1){
		query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@guild+"'", .@acc, .@char);
	}
		for(set .@j,0; .@j<getarraysize(.@acc); set .@j,.@j+1){
			if (isloggedin(.@acc[.@j],.@char[.@j])) {
				query_sql("SELECT last_ip FROM `guild_member` WHERE account_id = '"+.@acc[.@j]+"'",.@ip1);
				query_sql("SELECT last_ip FROM `guild_package` WHERE account_id = '"+.@acc[.@j]+"'",.@ip2);
			if(.@ip1 == .@ip2){
				message rid2name(.@acc[.@j]),"Sorry but you can't cheat on this system.";
			}
			                set .@members,.@members+1;   
		}
	}
             
	sleep 2;
	return;

here is the code.. I just want a limit on the query... the query must detect only 1 last_ip.

Example: I got 2 players in one shop.. number 1 and number 2 both of them has a same last_ip and same guild..what I want is if  number 1 is the first listed on the query then number 2 can not be listed to the query because  number 1 is already listed.. I hope some will share..

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

.@count = query_sql( "select distinct `account_id` from `char` where `online` = 1 and `account_id` = ( select `login`.`account_id` from `login` "+
	"left join `char` on `char`.`account_id` = `login`.`account_id` where `guild_id` = "+ .@guild_id +" group by `last_ip` ) order by `account_id` asc", .@account_id );

.@account_id give you the list of first account id with the same ip of the player online in the guild .@guild_id

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