I am just wondering why this script don't kick any char if they use double login in "prtg_cas01", "schg_cas01", "bat_room" and "prtg_cas02". There is something wrong with this?
Have no error when I start the server.
- script dualclientkicker -1,{
OnPCLoadMapEvent:
set .@charmap$, strcharinfo(3);
if(!compare(.tmp$,.@charmap$)) end;
//set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` = (SELECT `last_ip` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a);
set .@len, query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",.@a ); //Annieruru Addition.
if(.@len-1) {
for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) {
getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d]));
if(.@charmap$==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) {
dispbottom "No se permite doble login.";
warp "geffen",0,0;
}
}
}
end;
OnInit:
setarray .maps$ , "prtg_cas01", "schg_cas01", "bat_room", "prtg_cas02";
set .lens , getarraysize(.maps$) ;
for(set(.a,0);.a<.lens;set(.a,.a+1)) {
setmapflag .maps$[.a], mf_loadevent ;
set .tmp$ ,.tmp$+.maps$[.a]+",";
}
}
Fixed it!! You can close now!!
- script dualclientkicker -1,{
OnPCLoadMapEvent:
set .@charmap$, strcharinfo(3);
if(!compare(.tmp$,.@charmap$)) end;
set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` = (SELECT `last_ip` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a);
//set .@len, query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",.@a ); //Annieruru Addition.
if(.@len-1) {
for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) {
getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d]));
if(.@charmap$==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) {
dispbottom "No se permite doble login.";
warp "geffen",0,0;
}
}
}
end;
OnInit:
setarray .maps$ , "prtg_cas01", "schg_cas01", "bat_room", "prtg_cas02";
set .lens , getarraysize(.maps$) ;
for(set(.a,0);.a<.lens;set(.a,.a+1)) {
setmapflag .maps$[.a], mf_loadevent ;
set .tmp$ ,.tmp$+.maps$[.a]+",";
}
}
Question
Dhall
Hi! Sorry about this!
I am just wondering why this script don't kick any char if they use double login in "prtg_cas01", "schg_cas01", "bat_room" and "prtg_cas02". There is something wrong with this?
Have no error when I start the server.
Fixed it!! You can close now!!
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.