Well I thought I had it planned out how I was going to do this but now that I've almost got it all coded the last part has me stumped. I wish to add in an ignore option for my players. Each person will have their own list. So they can add and remove people from it as they wish. All that happens when u add someone to a list is thier name gets added.
Now the trouble part, how could I go about blocking saw someone's world << "Text" from going to the person that has them ignored??
LJR
ID:154226
Mar 25 2002, 5:42 pm
|
|
This should work:
mob/var/list/Blocked = list() |
LordJR wrote:
Now the trouble part, how could I go about blocking saw someone's world << "Text" from going to the person that has them ignored?? You won't be able to use world << "Text". You'll have to write your own routine that loops through each player, determines if the player is ignoring the source of the text, and if not, display the text to the individual player. proc/Output(message as text, reciever = world.contents, mob/sender = usr) Here are some examples using the above Output() proc </dm> mob/verb say(msg as text) desc = "(message) Message everyone in view." Output("[src] says: [msg]",view()) shout(msg as text) desc = "(message) Message everyone in the world." Output("[src] shouts:[msg]") // uses default values for the other two arguments tell(mob/M, msg as text) desc = "(target, message) Send a private message to one target." Output("[src] tells you: [msg]", M) src << "You tell [M]: [msg]" </dm> |
You can't block "world" itself. You'd need to actually make a proc that builds a list of people who are allowed to read it.
For example:
mob/proc/world()
var/list/L = list()
for(var/mob/M in world)
if(!M.ignore.Find(src.key))
L += M
return(L)
Now you can use
world() << "Text"
and everyone who is ignoring this user will see nothing. Neat, eh?