Well I want to make it so Admins/Gms can hear anything and everything that anyone says. It is easy with some verbs (like world_say) because everyone is suppose to hear. The problem is with whispering naturally only one person is suppose to hear it. So how would I make it so admins/Gms can see the message as well.
This is the code I use for whispering.
Whisper(mob/M as mob in world,msg as message)
if (!M.key)
usr << "Thats a NPC!"
return
M << "[usr] whispers:\"[msg]\""
usr << "You whisper \"[msg]\" to [M]."
and all the admins are stored in a list (called Adminlist).
So any ideas?
ID:175503
![]() Apr 15 2003, 12:33 pm
|
|
![]() Apr 15 2003, 12:52 pm
|
|
How about:
|
There's no reason why it should'nt work if your list was created properly. It should either have src added to it if you're adding admins to it using a verb(ie Login), or should contain their keys when you define it.
|
This is what I'm using to define the admins keys and it works with everything else.
var/Adminlist = list("Yuugi") |
Yuugi wrote:
This is what I'm using to define the admins keys and it works with everything else. The list needs to contain a reference to the mob of the admin not a key. When you create your mob make sure and add it to the Adminlist not its key. |
That won't work either, Nadz, because it's still searching for mobs in the list. That has exactly the same effect as adminlist << "Stuff".
|
Why not just log it, then make the admins able to check the logs? This way, admins wouldn't get huge quantities of text lagging them down and making it impossible for them to play.
world.log << "Speech/[world.time]/[src] : [msg]/[M]" I use the world log quite alot, for things like the automated payment system (in creds, of course). That way, I can check what happens without being in the game. |
I don't get logs thats why I didn't use them. I can never find the file were something is logged to.
Were will the message be logged to? |
Ahh I see now why the other's examples didn't work. If you do like Theodis said, you can do the Adminlist << "[msg]" or whatever, but if you want to keep it like you have it, do this:
//I will also show you how to make an easier to use whisper verb: Whisper() //Make a list of all the players in the world var/list/L = list() for(var/mob/M2 in world) if(M2.client) //Add the player to the list. L += M2 var/mob/M = input("Who do you want to send a whisper to?","Whisper:") in L var/msg = input("Type your message:","Message:") as text|null if(msg == null||msg == "") return M << "[usr] whispers:\"[msg]\"" usr << "You whisper \"[msg]\" to [M]." ////////////Now for the To-All-GMs part://////////// for(var/mob/GM in L) if(Adminlist.Find(GM.key)) GM << "[usr] whispered:\"[msg]\" to [M]." |
The message (as far as I know) is logged to an internal game thing. If you wanted to retain the logs, you would have to store them in a savefile, but to simply view them, you would just
src << world.log |
mob/verb/whisper(mob/m, t as text) I havent tested it, but it looks like its a go =P |
That would do nothing except give two messages to people with an admin var of 1 if you send them a message.
|
Kunark wrote:
Ahh I see now why the other's examples didn't work. If you do like Theodis said, you can do the Adminlist << "[msg]" or whatever, but if you want to keep it like you have it, do this: Of course, that could be considerably shortened.. mob/verb/Whisper(mob/TargetMob, TheMessage as text) ~>Volte |