ID:273911
 
I am trying to make a verb for a game where you click it and a box pops up to every player in the world asking, "Do you want to become a GM?" If they click either one nothing happens. Can someone please tell me how to code a verb like that?
You can do this one of two ways. One is to have a skin window made for it. I can toss you some references for that.

The other way is to use a simple alert() proc. Send it to everyone in world.

Although I don't see the point of a verb that does nothing.
In response to Lugia319 (#1)
    GMPrank()
set name="GMPrank"
set category="Admin"
for(var/mob/M in world)
switch(alert("Do you want to become a GM?","","Yes","No"))
if("Yes")
return
if("No")
return


This is what I have, but when I click the verb, the box only appears to me, how do I make it to pop-up to everyone?
In response to Dr.DraX (#2)
The alert() proc has a 1st argument that you can modify. Run a loop through the world for all mobs (with clients) and send it to them.
In response to Lugia319 (#3)
I'm sorry, I don't understand code that well. Could you tell me what to replace and add/delete?
In response to Dr.DraX (#4)
I could, but then you learn nothing. I will explain what I meant though. Here is the copypasta from the F1 menu (which you should learn to love)

Format:
alert(Usr=usr,Message,Title,Button1="Ok",Button2,Button3)
Returns:
Selected button
This sleeps the current proc until the user clicks one of the named buttons. As with input(), the first argument may be entirely left out.


Let's examine the format.

The first arg, usr by default is what the message goes to. THIS IS THE ARG THAT I WAS TALKING ABOUT. FIND A WAY TO MODIFY IT TO SUIT YOUR NEEDS

The second arg is message. Self explanatory, it's the message that's shown in the alert

The third arg is the title, it's what's show in the blue bar above the message

The fourth, fifth, and sixth args are buttons that you can set. (Yes, if you got ahead of me, you'll note that there can only be a max of three buttons)

So we need a way to modify the first arg to send to world. I'd recommend defining a var through a for() loop that goes through the world. Then you put that variable as the first arg (because the world loop you want should return a certain reference). Then the alert will go to that reference.
In response to Lugia319 (#5)
I have no idea what you just said, but I'll keep trying.
In response to Dr.DraX (#6)
READ what he just said.
In response to Dr.DraX (#6)
What confuses you? Please be as specific as you can, because saying that "Everything" confuses you doesn't help me clarify it at all.
In response to Lugia319 (#8)
As I said before, this is what I have.

GMPrank()
set name="GMPrank"
set category="Admin"
for(var/mob/M in world)
if(M) // Make sure they have a mob
switch(alert("Would you like to be a GM?","","Yes","No"))
if("Yes")
return
if("No")
return


I was asking how I have to modify it so it appears to everyone besides me.
In response to Dr.DraX (#9)
I just told you how. I am not going to give you code to copy/paste because then you learn nothing, and then in 2 hours you're going to be like, "How do I get this next thing that's almost exactly like this thing to do this same function?!"