ID:161452
 
For team games (red vs. blue) How would i make a var or something to represent your team. For instance:
choose your team: Red / Blue
(picks red)
how would you be on red team then?
EDIT: how to save would be helpful too plz
var/team


If they pick red,

team="Red"
In response to Ease
Ease wrote:
var/team

If they pick red,

team="Red"

I am still kinda dazed and confused, i know its a bit much, but can you explain it more?
In response to Jujitsubb777
mob/var/Team //variable for you to define your team 
switch(alert("What team do you want to be in?","Choosing Team","Blue","Red")) // put this in a proc or verb
if("Red") usr.Team = "Red" //making their team red
if("Blue") usr.Team = "Blue" //making their team blue
mob/verb/Check() //a mob verb to check which team you are
switch(alert("So, you'd like to check what team you're in, huh?","Checking Team","Yes","No")) //question thingy
if("Yes") usr<<"You're in Team \"[usr.Team]\"." // yes cause
if("No") usr<<"Okay..." // no cause


I hope it's something worth to you. =)
I would personally make a Team datum for a case like this:
#define RED  1
#define BLUE 2

mob/var/Team/team//a way to reference what team they're on

Team
var
color
list/members//members of the team, note that it doesn't contain the leader of the team
mob/leader//You may delete this var if
New(color,mob/leader,members[])
src.color=color
src.leader=(ismob(leader))? leader : null
leader.team=src
if(members && members.len)//If more than color is passed as an arg
for(var/mob/player in members)
src.members+=player//add to list
player.team=src//reference the team

proc/createTeam(color,mob/leader,members[])
if(istype(leader))//if the leader is a mob
new/Team(color,leader,members)//create Team
//the following is an example of how to view the members.
mob/proc/Team_Members()
for(var/o in team.members)
src<<o



In response to Kakashi24142
lol kakashi, the guy doesnt even understand how to set a team variable to red or blue and you throw something like that at him?