Hum, I dislike the way that script was created, so...
function script checkmap {
setarray .@maps$[0],"geffen"; // List of Maps
set .@map$, getarg(0);
set .@count, getarraysize(.@maps$);
for(set .@i,0; .@i < .@count; set .@i,.@i+1){
if (.@map$ == .@maps$[.@i]){
return 1;
}
}
return 0;
}
- script blockdc -1,{
end;
OnPCLoadMapEvent:
getmapxy .@map$, .@x, .@y, 0;
set .@result, callfunc("checkmap", .@map$);
if (.@result == 0){
end;
}
set .@account_id, getcharid(3);
set .@query$, "SELECT `last_ip` FROM `login` WHERE `account_id` =" + .@account_id;
set .@result, query_sql(.@query$, .@last_ip$);
set .@query$, "SELECT DISTINCT `login`.`account_id` FROM `char`,`login` WHERE `login`.`last_ip` = '" + .@last_ip$ + "' AND `char`.`online` = 1";
set .@result, query_sql(.@query$, .@account_id2);
set .@count, .@result;
if (.@result > 1){
for (set .@i,0; .@i < .@count; set .@i,.@i+1){
if (.@account_id != .@account_id2[.@i]){
if (attachrid(.@account_id2[.@i])){
getmapxy .@map$, .@x, .@y, 0;
set .@result, callfunc("checkmap", .@map$);
if (.@result == 1){
// Change here what you want the script to do
atcommand "@kick "+strcharinfo(0);
}
detachrid;
}
}
}
}
}
// List of Maps to Load the OnPCLoadMapEvent
geffen mapflag loadevent
I made it to work on Geffen, when a second Account enters into Geffen and there's already a Account with some IP, the first one will be kicked. Change it the way you like.