ID:268956
 
Ehh, Okay, Im making a board game based off of Stratego, it uses usermax==2 so no more then 2 players can join... anyway, my question is, how do I make an auto color chooser when a player logs in, like, the first person who logs in is the color red, and the second is the color blue and they can only 'build' objects of mob type mob/Red/Blue depending on their color.... and when I say build, either the red or blue unit icons will appear in their stat panels,
I *might* be able to do the building units thing, it shouldn't be to hard.
var/tmp/red=null
var/tmp/blue=null

mob/Login()
if(!red)red=src
else if(!blue) blue=src
else
src<<"Sorry, all player slots are already full."
del src
..()


This allows you to keep track of player 1 and 2 using the variables red, and blue. If both are already taken it will tell them so and then delete them (which will boot them from the game).

For the build objects you can than give them the appropriate verbs (Build_red, destroy_red, etc.) or give them generic verbs (Build, Destroy, etc.) and check if they are red or blue, and then build appropriatly.