Skip to content

Instantly share code, notes, and snippets.

@secretdataz
Created November 22, 2016 11:50
Show Gist options
  • Save secretdataz/0810a8d3fa89e02d73787adcf19b9854 to your computer and use it in GitHub Desktop.
Save secretdataz/0810a8d3fa89e02d73787adcf19b9854 to your computer and use it in GitHub Desktop.
ip
guild_vs2-2,0,0,0 script abcde#5 -1,{
end;
OnPCLoadMapEvent:
.@amap$ = strcharinfo(3);
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);
.@aidtemp = getcharid(3);
detachrid;
.@sz = getarraysize(.@AccountId);
for(.@i = 0; .@i < .@sz; .@i++)
{
if(attachrid(.@AccountId[.@i]))
{
if (strcharinfo(3) == .@amap$) .@j++;
}
detachrid;
}
attachrid .@aidtemp;
if(.@j > .MaxWimdows)
warp "SavePoint",0,0;
end;
OnInit:
set .MaxWimdows,1;
end;
}
//------Enable map OnPCLoadMapEvent-------------------
guild_vs2-2 mapflag loadevent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment