Hi, I use gepard on my server, and I wanted to block the same person from accessing the same map with two accounts. I tried to change the last_ip to last_unique_id, but it blocks all people from accessing the map if there is already a person in it.
- script dualclientkicker -1,{
OnPCLoadMapEvent:
set .@charmap$, strcharinfo(3);
query_sql("SELECT FIND_IN_SET('"+.@charmap$+"', '"+.maps$+"');",.@q);
if(.@charmap$!=.tmp$[(.@q-1)]) 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);
if(.@len-1) {
for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) {
getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d]));
if(.tmp$[(.@q-1)]==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) {
dispbottom "Duel accounts not allowed in WOE.";
atcommand "@kick "+strcharinfo(0);
}
}
}
end;
OnInit:
set .maps$ , "aldeg_cas01,gefg_cas01,payg_cas01,prtg_cas01";
explode( .tmp$ , .maps$, ",") ;
set .lens , getarraysize(.tmp$) ;
for(set .a,0;.a<.lens;set .a,.a+1)
setmapflag .tmp$[.a], mf_loadevent ;
}
Question
guhx
Hi, I use gepard on my server, and I wanted to block the same person from accessing the same map with two accounts. I tried to change the last_ip to last_unique_id, but it blocks all people from accessing the map if there is already a person in it.
- script dualclientkicker -1,{ OnPCLoadMapEvent: set .@charmap$, strcharinfo(3); query_sql("SELECT FIND_IN_SET('"+.@charmap$+"', '"+.maps$+"');",.@q); if(.@charmap$!=.tmp$[(.@q-1)]) 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); if(.@len-1) { for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) { getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])); if(.tmp$[(.@q-1)]==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) { dispbottom "Duel accounts not allowed in WOE."; atcommand "@kick "+strcharinfo(0); } } } end; OnInit: set .maps$ , "aldeg_cas01,gefg_cas01,payg_cas01,prtg_cas01"; explode( .tmp$ , .maps$, ",") ; set .lens , getarraysize(.tmp$) ; for(set .a,0;.a<.lens;set .a,.a+1) setmapflag .tmp$[.a], mf_loadevent ; }
Link to comment
Share on other sites
2 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.