Yami Posted October 23, 2015 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 111 Reputation: 2 Joined: 01/02/14 Last Seen: June 4, 2023 Share Posted October 23, 2015 Hi, I have this script and I want to add more maps on it. Here's the script. I like to add this maps besides the one already declared, and maybe more in the future. Thank you. "prtg_cas01","schg_cas01","arug_cas01" - script GuildLimit1 -1,{ OnPCLoadMapEvent: getmapxy .@map$, .@x, .@y, 0; if ( .@map$ == "aldeg_cas01" ) { query_sql "SELECT `connect_member` FROM `guild` WHERE `guild_id` = '" +getcharid(2)+ "'",.@c; if ( .@c > 10 ) { message strcharinfo(0),"Your guild members are over the limit"; sleep2 2000; warp "prontera",156,183; } } end; } Quote Link to comment Share on other sites More sharing options...
Haziel Posted October 23, 2015 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 609 Joined: 11/25/11 Last Seen: March 7 Share Posted October 23, 2015 Well, you can just change the If, if there will will be only a few maps to: if ( .@map$ == "aldeg_cas01" || .@map$ == "prtg_cas01" || .@map$ == "arug_cas01" || .@map$ == "schg_cas01") { Since || means 'or'. Or else, you can set an array and verify it with a for, something like: setarray .@maps$[0],"aldeg_cas01","prtg_cas01","arug_cas01","schg_cas01"; getmapxy .@map$, .@x, .@y, 0; for(set .@i,0; .@i < .@count; set .@i,.@i+1){ if (.@map$ == .@maps$[.@i]){ query_sql "SELECT `connect_member` FROM `guild` WHERE `guild_id` = '" +getcharid(2)+ "'",.@c; if ( .@c > 10 ) { message strcharinfo(0),"Your guild members are over the limit"; sleep2 2000; warp "prontera",156,183; } end; } } end; Also, remember that only maps with loadevent mapflag will trigger the OnPCLoadMapEvent label. Quote Link to comment Share on other sites More sharing options...
Yami Posted October 23, 2015 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 111 Reputation: 2 Joined: 01/02/14 Last Seen: June 4, 2023 Author Share Posted October 23, 2015 Thanks Haziel, will test this now. Yes i have the mapflag for the loadevents on a different script, I tend to put all my mapflags on a seperate one so It's all in one place. Oh BTW, i think i should change the .@c into .@count as what you made. Quote Link to comment Share on other sites More sharing options...
Haziel Posted October 23, 2015 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 609 Joined: 11/25/11 Last Seen: March 7 Share Posted October 23, 2015 (edited) Sorry, that's my fault, that .@count must be replaced by: for(set .@i,0; .@i < getarraysize(.@maps$); set .@i,.@i+1){ It's not related to your .@c. Edited October 23, 2015 by Haziel Quote Link to comment Share on other sites More sharing options...
Yami Posted October 23, 2015 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 111 Reputation: 2 Joined: 01/02/14 Last Seen: June 4, 2023 Author Share Posted October 23, 2015 Oh okay! Haha thanks, I'll get back to you soon as I've tested it. Quote Link to comment Share on other sites More sharing options...
Question
Yami
Hi, I have this script and I want to add more maps on it. Here's the script.
I like to add this maps besides the one already declared, and maybe more in the future. Thank you.
"prtg_cas01","schg_cas01","arug_cas01"
Link to comment
Share on other sites
4 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.