LearningRO Posted March 29, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Share Posted March 29, 2018 somebody can make me script to filter guild in certain map and only guild id set in list array can enter that map another will be warp to savepoint Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted March 31, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted March 31, 2018 (edited) ah ... found a bug I forgotten the loadevent can be use from another script if you install another script with loadevent mapflag will cause this script to warp out other players indiscriminately 1 more time http://upaste.me/06e6495427daded7f EDIT: Jesus ... I made mistake too many times, really lost touch with scripting yeah ... atm, not a godlike scripter yet XD btw, did you guys mentioned wrong person ?? I am @AnnieRuru not @Annie Ruru Edited March 31, 2018 by AnnieRuru 1 2 Quote Link to comment Share on other sites More sharing options...
0 pajodex Posted March 29, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: April 14 Share Posted March 29, 2018 (edited) 1 hour ago, melv0 said: somebody can make me script to filter guild in certain map and only guild id set in list array can enter that map another will be warp to savepoint Not tested - script checkguild -1,{ OnPCLoadMapEvent: for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) warp "SavePoint",0,0; end; OnInit: setarray .guild_id, <ID>, <ID>; // enter guild id setarray .maps$,"prontera","geffen"; for ( .@i = 0; .@i < getarraysize(.maps$); .@i++) setmapflag .maps$[.@i],mf_loadevent; end; } or this: - script checkguild -1,{ OnPCLoadMapEvent: for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) warp "SavePoint",0,0; end; OnInit: setarray .guild_id, <ID>, <ID>; // enter guild id end; } prontera mapflag loadevent geffen mapflag loadevent Edited March 29, 2018 by pajodex Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted March 30, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted March 30, 2018 (edited) 13 hours ago, pajodex said: Not tested - script checkguild -1,{ OnPCLoadMapEvent: for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) warp "SavePoint",0,0; end; OnInit: setarray .guild_id, <ID>, <ID>; // enter guild id setarray .maps$,"prontera","geffen"; for ( .@i = 0; .@i < getarraysize(.maps$); .@i++) setmapflag .maps$[.@i],mf_loadevent; end; } or this: - script checkguild -1,{ OnPCLoadMapEvent: for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) warp "SavePoint",0,0; end; OnInit: setarray .guild_id, <ID>, <ID>; // enter guild id end; } prontera mapflag loadevent geffen mapflag loadevent actually I will implement these scripts in the map castle which already have mapflag loadevent, so if I use this script, all the maps that have a loadevent mapflag will be affected. is there any solution so that only affects the maps I want only Edited March 30, 2018 by melv0 Quote Link to comment Share on other sites More sharing options...
0 pajodex Posted March 30, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: April 14 Share Posted March 30, 2018 20 minutes ago, melv0 said: actually I will implement these scripts in the map castle which already have mapflag loadevent, so if I use this script, all the maps that have a loadevent mapflag will be affected. is there any solution so that only affects the maps I want only - script checkguild -1,{ OnPCLoadMapEvent: for ( .@q = 0; .@q < getarraysize(.maps$); .@q++) if(strcharinfo(3) != .map$[.@q]) end; for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) warp "SavePoint",0,0; end; OnInit: setarray .guild_id, <ID>, <ID>; // enter guild id setarray .maps$,"prontera","geffen"; // add maps end; Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted March 30, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted March 30, 2018 13 minutes ago, pajodex said: - script checkguild -1,{ OnPCLoadMapEvent: for ( .@q = 0; .@q < getarraysize(.maps$); .@q++) if(strcharinfo(3) != .map$[.@q]) end; for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) warp "SavePoint",0,0; end; OnInit: setarray .guild_id, <ID>, <ID>; // enter guild id setarray .maps$,"prontera","geffen"; // add maps end; sir not working script didn't read guild id, player still can enter without guild or guild not list in my array - script checkguild -1,{ OnPCLoadMapEvent: for ( .@q = 0; .@q < getarraysize(.maps$); .@q++) if(strcharinfo(3) != .map$[.@q]) end; for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) mes "mes"; end; OnInit: setarray .guild_id, 76, 77; // enter guild id setarray .maps$,"prtg_cas04","prtg_cas02"; // add maps end; } this is what i was try Quote Link to comment Share on other sites More sharing options...
0 pajodex Posted March 30, 2018 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: April 14 Share Posted March 30, 2018 1 hour ago, melv0 said: sir not working script didn't read guild id, player still can enter without guild or guild not list in my array - script checkguild -1,{ OnPCLoadMapEvent: for ( .@q = 0; .@q < getarraysize(.maps$); .@q++) if(strcharinfo(3) != .map$[.@q]) end; for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) mes "mes"; end; OnInit: setarray .guild_id, 76, 77; // enter guild id setarray .maps$,"prtg_cas04","prtg_cas02"; // add maps end; } this is what i was try - script checkguild -1,{ OnPCLoadMapEvent: addrid(0); for ( .@q = 0; .@q < getarraysize(.maps$); .@q++) if(strcharinfo(3) != .map$[.@q]) end; for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) mes "mes"; end; OnInit: setarray .guild_id, 76, 77; // enter guild id setarray .maps$,"prtg_cas04","prtg_cas02"; // add maps end; } Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted March 31, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted March 31, 2018 19 hours ago, pajodex said: - script checkguild -1,{ OnPCLoadMapEvent: addrid(0); for ( .@q = 0; .@q < getarraysize(.maps$); .@q++) if(strcharinfo(3) != .map$[.@q]) end; for ( .@i = 0; .@i < getarraysize(.guild_id); .@i++) if ( getcharid(2) != .guild_id[.@i]) mes "mes"; end; OnInit: setarray .guild_id, 76, 77; // enter guild id setarray .maps$,"prtg_cas04","prtg_cas02"; // add maps end; } still not working sir player still can enter map castle and didn't show message "MES" @Alayne can u help me with this script Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted March 31, 2018 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted March 31, 2018 (edited) https://pastebin.com/f9aFiDfv you can try something like this. Edited March 31, 2018 by Emistry Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted March 31, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted March 31, 2018 42 minutes ago, Emistry said: https://pastebin.com/f9aFiDfv you can try something like this. still not working @Emistry i think script didn't read array guild_id Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted March 31, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted March 31, 2018 @emistry .@map$ = strcharinfo(3); for (.@i = 0; .@i < .map_size; .@i++) { if (.@map$ == .map$[.@i]) { if (getcharid(2) != .guild_id[.@i] && .guild_id[.@i] > 0) warp "SavePoint",0,0; end; } } just 1 glance and I can tell this is wrong since you are comparing 2 different kinds of information -> .@map$ == .map$[.@i] and getcharid(2) == .guild_id[.@i] shouldn't the 2nd one fall into another loop with .@j index? for(.@j = 0; .@j < guild_id_size; .@j++) <<--- something like this ? Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted March 31, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted March 31, 2018 5 minutes ago, AnnieRuru said: @emistry .@map$ = strcharinfo(3); for (.@i = 0; .@i < .map_size; .@i++) { if (.@map$ == .map$[.@i]) { if (getcharid(2) != .guild_id[.@i] && .guild_id[.@i] > 0) warp "SavePoint",0,0; end; } } just 1 glance and I can tell this is wrong since you are comparing 2 different kinds of information -> .@map$ == .map$[.@i] and getcharid(2) == .guild_id[.@i] shouldn't the 2nd one fall into another loop with .@j index? for(.@j = 0; .@j < guild_id_size; .@j++) <<--- something like this ? hi, @Annie Rurui try to change but still can't read guild_id or nothing happern player without guild or player with guild_id "3" still can enter map - script sample -1,{ OnInit: setarray .guild_id, 1, 2; .guild_id_size = getarraysize(.guild_id); setarray .maps$, "prtg_cas04"; .map_size = getarraysize(.maps$); for (.@i = 0; .@i < .map_size; .@i++) setmapflag .maps$[.@i], mf_loadevent; end; OnPCLoadMapEvent: .@map$ = strcharinfo(3); for (.@j = 0; .@j < .map_size; .@j++) { if (.@map$ == .map$[.@i]) { if (getcharid(2) != .guild_id[.@j] && .guild_id[.@j] > 0) Mes "Testing"; end; } } end; } Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted March 31, 2018 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted March 31, 2018 10 minutes ago, melv0 said: still not working @Emistry i think script didn't read array guild_id https://pastebin.com/f9aFiDfv the variable name was wrong. fixed. @Annie Ruru well, if it was multiple guild and multiple map, then ya it should be another loop to check for guild the sample above are just made for 1 map for 1 guild. Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted March 31, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted March 31, 2018 (edited) 17 minutes ago, Emistry said: https://pastebin.com/f9aFiDfv the variable name was wrong. fixed. @Annie Ruru well, if it was multiple guild and multiple map, then ya it should be another loop to check for guild the sample above are just made for 1 map for 1 guild. hi, @Emistry yeah it' work but when i want to try to make multiple guild_Id it only read first array guild_id and player with guild_Id "2" can't enter maps this is was i try - script sample -1,{ OnInit: setarray .guild_id, 1, 2; .guild_id_size = getarraysize(.guild_id); setarray .map$, "prtg_cas04"; .map_size = getarraysize(.map$); for (.@i = 0; .@i < .map_size; .@i++) setmapflag .map$[.@i], mf_loadevent; end; OnPCLoadMapEvent: .@map$ = strcharinfo(3); for (.@i = 0; .@i < .map_size; .@i++) { if (.@map$ == .map$[.@i]) { for (.@j = 0; .@j < .guild_id_size; .@j++) if (getcharid(2) != .guild_id[.@j] ) mes "Debug"; end; } } end; } Edited March 31, 2018 by melv0 Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted March 31, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted March 31, 2018 (edited) hmm ... nvm ... let me try this myself then of course I tested on my test server b4 posting EDIT: stupid forum IPB3 .... IPB1 is far superior than IPB3 http://upaste.me/06e6495427daded7f Edited March 31, 2018 by AnnieRuru 1 Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted March 31, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted March 31, 2018 9 minutes ago, AnnieRuru said: hmm ... nvm ... let me try this myself then of course I tested on my test server b4 posting - script sample -1,{ OnInit: setarray .guild_id, 1,2; // allowed guild ID .guild_id_size = getarraysize(.guild_id); setarray .map$, "prontera","payon"; // restricted map .map_size = getarraysize(.map$); for (.@i = 0; .@i < .map_size; .@i++) setmapflag .map$[.@i], mf_loadevent; end; OnPCLoadMapEvent: // GMs should bypass this kind of things // if ( getgmlevel() >= 99 ) end; .@map$ = strcharinfo(3); for (.@i = 0; .@i < .map_size; .@i++) if (.@map$ == .map$[.@i]) for ( .@j = 0; .@j < .guild_id_size; .@j++ ) if (getcharid(2) == .guild_id[.@j]) end; // if all condition met, the player isn't warp away // falls here if the condition failed warp "Save",0,0; end; } fully working what i want thanks a loot @Annie Ruru Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted March 31, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted March 31, 2018 51 minutes ago, AnnieRuru said: ah ... found a bug I forgotten the loadevent can be use from another script if you install another script with loadevent mapflag will cause this script to warp out other players indiscriminately 1 more time http://upaste.me/06e6495427daded7f EDIT: Jesus ... I made mistake too many times, really lost touch with scripting yeah ... atm, not a godlike scripter yet XD btw, did you guys mentioned wrong person ?? I am @AnnieRuru not @Annie Ruru ahh thx u @AnnieRuru and sorry about that i didn't know have 2 annieruru in here Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted April 1, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted April 1, 2018 (edited) Sorry @AnnieRuru i try your last script but only read frist array guild_id - script WoE -1,{ OnInit: setarray .guild_id, 77,78; // allowed guild ID .guild_id_size = getarraysize(.guild_id); setarray .map$, "prtg_cas04","prtg_cas03"; // restricted map .map_size = getarraysize(.map$); for (.@i = 0; .@i < .map_size; .@i++) setmapflag .map$[.@i], mf_loadevent; end; OnPCLoadMapEvent: // GMs should bypass this kind of things // if ( getgmlevel() >= 99 ) end; .@map$ = strcharinfo(3); for (.@i = 0; .@i < .map_size; .@i++) { if (.@map$ == .map$[.@i]) { // is on the map for ( .@j = 0; .@j < .guild_id_size; .@j++ ) { if (getcharid(2) == .guild_id[.@j]) { mes "sukses"; end; // if the condition met, the player isn't warp away } mes "You are not allowed"; end; } } end; } } this script only read frist array in guild_id so player with guild_id "78" still can entry the map Update : i think this script only read frist array on guild_id and map$ Edited April 1, 2018 by melv0 Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted April 1, 2018 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted April 1, 2018 #$%@#$^#&&^)(*&_#$%@#$!@#$%#!!@#@%$& ............ [Error]: Missing 1 right curlys in file 'npc/zzz.txt', line '183'. 1 more time I modified the paste Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted April 1, 2018 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 9 hours ago Author Share Posted April 1, 2018 (edited) 5 minutes ago, AnnieRuru said: #$%@#$^#&&^)(*&_#$%@#$!@#$%#!!@#@%$& ............ [Error]: Missing 1 right curlys in file 'npc/zzz.txt', line '183'. 1 more time I modified the paste yeah i know about that and fix it by myself but this script still only read frist array sorry last script work perfectly Edited April 1, 2018 by melv0 Quote Link to comment Share on other sites More sharing options...
Question
LearningRO
somebody can make me script to filter guild in certain map and only guild id set in list array can enter that map another will be warp to savepoint
Link to comment
Share on other sites
19 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.