Jump to content
  • 0

Help with disabling dual client in a map via macip ( harmony )


Pacman360

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  30
  • Reputation:   1
  • Joined:  04/25/14
  • Last Seen:  

Can anyone help me with this script out? It's working fine. but the problem is even if the dual is not inside the map it's still getting kick. Like if client 1 = goes inside restricted map. client 2= gets kicked even AFKing in maintown and not in a same map with client 1.

 

Here's the script:

 

- script duald -,{

 
OnPCLoadMapEvent:
        set .@name$, strcharinfo(0);
        set .@map$,strcharinfo(3);
        if (query_sql("SELECT `char`.`name` FROM `char` LEFT JOIN login ON `char`.account_id=login.account_id WHERE login.last_mac=(SELECT last_mac FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1 AND `char`.char_id!="+getcharid(0), .@name$) >= 1) {
                for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {
                        if ( ( .@map$=="schg_cas07" || .@map$=="schg_cas08" || .@map$=="arug_cas06" || .@map$=="arug_cas07" || .@map$=="arug_cas08" || .@map$=="rush_cas01" || .@map$=="rush_cas02" || .@map$=="rush_cas03" || .@map$=="rush_cas04" || .@map$=="bat_b03" ) )
                                set .@samemac, .@samemac +1;
                }
                if (.@samemac >= 1) {
                        announce "Sorry, only 1 account per computer can be logged in at a time on this map.", bc_self;
                         atcommand "@kick " + .@name$;
                }
        }
        end;
}
Edited by Pacman360
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  


- 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_mac` = (SELECT `last_mac` 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 "Duel accounts not allowed in WOE.";

warp "geffen",0,0;

}

}

}

end;

OnInit:

setarray .maps$ , "aldeg_cas01", "gefg_cas01", "payg_cas01", "prtg_cas01";

set .lens , getarraysize(.maps$) ;

for(set(.a,0);.a<.lens;set(.a,.a+1)) {

setmapflag .maps$[.a], mf_loadevent ;

set .tmp$ ,.tmp$+.maps$[.a]+",";

}

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...