rizsu0107 Posted November 15, 2023 Group: Members Topic Count: 13 Topics Per Day: 0.02 Content Count: 40 Reputation: 1 Joined: 06/24/22 Last Seen: Sunday at 03:18 PM Share Posted November 15, 2023 (edited) Good day, in my script i encounter this error. I can't find a way to fix. - script Gold_Room_Max_Account -1,{ OnPCLoadMapEvent: if(getgmlevel() >= 99){ end; } 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 `ragnarok_accounts`.`login` WHERE `last_ip` = (SELECT `last_ip` FROM `ragnarok_accounts`.`login` WHERE `account_id` = "+getcharid(3)+")) AND `online` <> 0;",.@a); for(set(.@d,0); .@d < .@len; set(.@d, .@d+1)) { if(!getmapxy(.@map$, .@x, .@y, BL_PC, rid2name(.@a[.@d])) && .@charmap$ == .@map$) set .@c, .@c + 1; } if(.@c > .limitacc ) { dispbottom "Maximum of 2 accounts are allowed in the Gold Room at a time!"; warp "thana_town", 100, 100; } end; OnInit: set .limitacc, 2; setarray .maps$, "rockrdg1"; set .lens, getarraysize(.maps$); for(set(.a, 0); .a < .lens; set(.a, .a+1)) { setmapflag .maps$[.a], mf_loadevent; set .tmp$, .tmp$ + .maps$[.a] + ","; } } Edited November 15, 2023 by Mael Use a codebox Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 18, 2023 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10013 Reputation: 2348 Joined: 10/28/11 Last Seen: Tuesday at 10:53 PM Share Posted November 18, 2023 for (.@d = 0; .@d < .@len; .@d++) { if (!isloggedin(.@a[.@d])) continue; if (!getmapxy(.@map$, .@x, .@y, BL_PC, rid2name(.@a[.@d])) && .@charmap$ == .@map$) set .@c, .@c + 1; } you can try add something like this to skip offline players Quote Link to comment Share on other sites More sharing options...
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.