- script Only1perIP -1,{
OnPCLoadMapEvent:
// Which maps to check? (remember to add 'loadevent' mapflag at the bottom)
set .@maps$, "schg_cas06,schg_cas07,schg_cas08";
if (!compare(","+.@maps$+"," , ","+strcharinfo(3)+",")) end;
// check for other online characters from their IP
if (query_sql("SELECT `char`.`name` FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id " +
"WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online AND login.account_id!="+getcharid(3), .@name$) > 0)
{
// check if they are on the same map
for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {
getmapxy .@map$, .@x,.@y,0, .@name$[.@i];
if (.@map$ == strcharinfo(3)) {
announce "Sorry, only 1 character per IP is allowed on this map.", bc_blue|bc_self;
sleep2 1000;
warp "SavePoint",0,0;
}
}
}
end;
}
schg_cas06 mapflag loadevent
schg_cas07 mapflag loadevent
schg_cas08 mapflag loadevent