ID:175086
 
is there anyway to list the gms in the world.. also can someone show me how to make it so it asks a gm if in the world a question?
Depending on how your GMs are set up...

<code>//If GMs have their "gm" var set to 1 mob/verb/List_GMs() src << "List of GMs:" for (var/mob/M in world) if (M.gm) src << M //If GMs have their key in a list mob/verb/List_GMs() src << "List of GMs:" for (var/mob/M in world) if (M.key in gmlist) src << M</code>

Simple for() loops.
Crispy covered the listing part. To make a verb like you want, I think this is how you would do it:


mob/verb/Ask_GM(t as text)
for(var/mob/M in world)
if(M.GM)
M << "[t]"
else
src << "There is(are) no GM(s) in the world."


That SHOULD work. Just give all your GMs a GM var.

*Hates the "word" GM* Can't people say admin? Or mod at least?


Airjoe
In response to Airjoe
What that will actually do is send the message (with no information about who sent it) to all GMs, but ALSO display the message "There are no GMs in the world" once PER NON-GM PLAYER.

I'll take the liberty of fixing it up a bit...

mob/verb/Ask_GM(t as text)
var/numofgms=0 //Number of GMs
for(var/mob/M in world)
if(M.GM)
M << "[src] asks all GMs: [t]"
numofgms++
if (numofgms>0)
src << "Asked all [numofgms] GMs: [t]"
else
src << "No GMs are currently logged in."