Jump to content
  • 0

Help to fix this NO dual script


Sallycantdance

Question


  • Group:  Members
  • Topic Count:  227
  • Topics Per Day:  0.14
  • Content Count:  800
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

hello i already try everything i can to fix this script im always having this error after i enter the map, can someone help me

[Error]: buildin_rid2name: invalid RID
[Error]: buildin_rid2name: invalid RID
[Error]: buildin_getmapxy: Player with nick '(null)' is not found.
[Error]: buildin_getmapxy: Player with map id '0' is not found.

 

Quote

-    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);
    
    // Check for results from query_sql
    if (.@len == 0) end;
    
    for (set .@d, 0; .@d < .@len; set(.@d, .@d+1)) {
        // Ensure the account ID is valid before proceeding
        if (rid2name(.@a[.@d]) != "") {
            if (!getmapxy(.@map$, .@x, .@y, BL_PC, rid2name(.@a[.@d])) && .@charmap$ == .@map$)
                set .@c, .@c + 1;  
        }
    }
    
    if (.@c > .limitacc) {
        dispbottom "Dual accounts not allowed in this map.";
        warp "SavePoint",0,0;
    }    
    end;

OnInit:
    set .limitacc, 1;
    setarray .maps$, "pvp_y_1-2", "prt_pvp", "grandarena", "bombring", "gh10", "gh11", "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

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...