This becomes a problem when you reach the 128 entry limit for arrays. Other than that, this should work.
- script dual_ip -1,{
OnPCLoadMapEvent:
getmapxy(.@amap$,.@mapx,.@mapy,0);
if(.@amap$!="xmas") end;
query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", .@LastIP$);
query_sql("SELECT account_id FROM `login` WHERE last_ip = '"+.@LastIP$+"'", .@AccountId);
set .@aidtemp,getcharid(3,strcharinfo(0));
for(set .@i ,0;.@i<getarraysize(.@AccountId);set .@i,.@i+1)
{
if(attachrid(.@AccountId[.@i]))
{
getmapxy(.@qmap$,.@qmapx,.@qmapy,0);
if (.@qmap$== .@amap$) set .@j,.@j+1;
}
detachrid;
}
attachrid .@aidtemp;
if(.@j > 1) {
dispbottom "You may not dual client on this map.";
warp "prontera",156,183;
}
end;
}
//------Enable map OnPCLoadMapEvent-------------------
xmas mapflag loadevent
Just replace xmas with the map of your choice.