Jump to content
  • 0
Sign in to follow this  
hideki6

limited broadcast

Question

12 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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 :P

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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;

B) Broadcast to any people that reach a level in a range [What I understood because of the post just before my previous one].

Share this post


Link to post
Share on other sites
  • 0
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;}

Share this post


Link to post
Share on other sites
  • 0

 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 by hideki6

Share this post


Link to post
Share on other sites
  • 0

 

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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites

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

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.