ID:268015
 
I've been trying to figure out how to code this:

A menu coming up when you Login asking you weather you want to be on the Red Team or the Blue Team.

And whatever team that person chooses, I want the world to see the usrs key and what team the usr is on.

Thanks.

~~SSJ4_Gohan_Majin
Make a variable called "team" (mob/var/team). In Login(), add an input() to select your team. team=input("What team?")in list("Red","Blue") After that, you can use the team variable in whatever way you want. (For instance, you said you wanted everyone to be able to see their team. I'm assuming you mean in a "who" type of verb. Do something like the example below for that.)

mob/verb/who()
var/list/players=list()
for(var/mob/M in world)
if(M.client)
src<<"[M.name] is on team [M.team]"


(edit)
Oh, if you meant that you wanted everyone to see the person's team when they log in, then just add world<<"[name] is now on [team] team." in your Login() (after the team selection, of course.)
SSJ4_Gohan_Majin wrote:
And whatever team that person chooses, I want the world to see the usrs key and what team the usr is on.

You need to get out of the habit of saying "the usr". usr is not equivalent to "the user" or "the player", and there's no "the" in a multiplayer environment. Always ask yourself: which player?

If all this takes place in a proc belonging to that mob, then src is the correct thing to use.

Lummox JR
In response to Lummox JR
Your constant nagging about not using usr in procs is paying off, maybe a bit too well. I've had several people come to me asking for help lately with their problems, and after examining their code snippets I see that they allways use src, even in the few times they should be using usr such as in Click(). You've scared the usr right out of them. ;)