hideki6 0 Posted November 28, 2013 hi,is there a way to limit a broadcast so that only level 1-20 players for example will get the broadcast? Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted November 28, 2013 Not in current scripting AFAIK. It could be feasible with a little workaround if the addrid script command was implemented, but we're having that pull request waiting ATM, don't know why Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 28, 2013 Maybe query all account id's on char table whose base level is < 20 and online <> 0 and then have a loop through those data gathered from the query_sql and attach their rid one by one? Not sure if this will work as i am not in my pc to test Quote Share this post Link to post Share on other sites
0 Mumbles 193 Posted November 28, 2013 Not sure if you want precisely only ~20 people to receive a global broadcast or if you're just trying to have only a few people in your vicinity be able to see a local broadcast. In that case, you might find localbroadcast and areabroadcast to be useful. Quote Share this post Link to post Share on other sites
0 hideki6 0 Posted November 28, 2013 a bit more procisely please, couldnt find anything i just want a broadcast to reach certain levels, for low level events and stuff Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted November 28, 2013 Like, when someone leveled up? You have these labels for that: OnPCBaseLvUpEvent:OnPCJobLvUpEvent: Quote Share this post Link to post Share on other sites
0 hideki6 0 Posted November 28, 2013 still dont get it.. could you please make a example. i was thinking of creating new broadcast commands through atcommand.c but dont know how to specify like level 1-20 and let the broadcast work like that Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted November 29, 2013 I don't get you, so maybe my last reply wasn't accurate. What do you exactly mean? a) Make a broadcast to every people in a range of levels; Broadcast to any people that reach a level in a range [What I understood because of the post just before my previous one]. Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 29, 2013 prontera,150,150,0 script Sample 100,{ mes "Input your message"; next; input .@m$; close2; if ( .@m$ != "" ) { query_sql "SELECT `account_id` FROM `char` WHERE `base_level` < 20 AND `online` = '1'",.@aid; while ( .@i < getarraysize(.@aid) ) { if ( attachrid( .@aid[.@i] ) ) dispbottom "" + .@m$ + ""; detachrid; .@i++; } } end;} 1 jaBote reacted to this Quote Share this post Link to post Share on other sites
0 hideki6 0 Posted December 1, 2013 (edited) this works but only the first person talking could see the message from all players sent.. the others cant prontera,150,150,0 script Sample 100,{ mes "Input your message"; next; input .@m$; close2; if ( .@m$ != "" ) { query_sql "SELECT `account_id` FROM `char` WHERE `base_level` < 20 AND `online` = '1'",.@aid; while ( .@i < getarraysize(.@aid) ) { if ( attachrid( .@aid[.@i] ) ) dispbottom "" + .@m$ + ""; detachrid; .@i++; } } end;} Edited December 1, 2013 by hideki6 Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted December 1, 2013 Tested on my test server and it works fine. How did you test the script? Quote Share this post Link to post Share on other sites
0 Mumbles 193 Posted December 1, 2013 prontera,150,150,0 script Sample 100,{ mes "Input your message"; next; input .@m$; close2; if ( .@m$ != "" ) { query_sql "SELECT `account_id` FROM `char` WHERE `base_level` < 20 AND `online` = '1'",.@aid; while ( .@i < getarraysize(.@aid) ) { if ( attachrid( .@aid[.@i] ) ) dispbottom "" + .@m$ + ""; detachrid; .@i++; } } end;} Not that it's a big deal or anything, but I'd say message would be more preferable over dispbottom; if a player has /notalkmsg2 on, they won't receive the message. Usage: message strcharinfo(0), "Some message here."; Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted December 1, 2013 In any way he can replace the dispbottom part. I attached all online player with < 20 base level. So i think the decision is up to the topic starter. I just made an example. Btw an array can store up to 128 values only. So if you have big population the script might not actually do the full work. Quote Share this post Link to post Share on other sites
hi,is there a way to limit a broadcast so that only level 1-20 players for example will get the broadcast?
Share this post
Link to post
Share on other sites