ID:178961
 
Okay, since I didn't get help fixing my code, I'm gonna ask this. I want to make a login proc where you enter your desired name, then gender, then class, and attributes will appear without bugging s_admin 2.0 or not working at all.
Example:
mob/Login()
..()
var/choice = input("What is your gender?","Gender") in list("Male","Female")
switch(choice)
if("Male")
usr <<"You are a male"
if("Female")
usr <<"You are a Female"
var/class = input("What is your class?","Character Class") in list("Blah","Blahblah","Blahblahblah")
switch(class)
if("Blah")
icon = 'Blah.dmi'
world <<"<b>[src] enters</b>!"
if("Blahblah")
icon = 'Blahblah.dmi'
world <<"<b>[src] enters</b>!"
if("Blahblahblah")
icon = 'Blahblahblah.dmi'
world <<"<b>[src] enters</b>!"
usr.name = input("What would you like to name yourself?","Name")as text

That should work.

-Non-PC
In response to Non-PC
Non-PC wrote:
var/class = input("What is your class?","Character Class") in list("Blah","Blahblah","Gay")
That should work.

No it shouldn't. Alot of people will get on you about this before long. I suggest you change it before the thread blows up.

-Rcet
In response to Rcet
Rcet wrote:
Non-PC wrote:
var/class = input("What is your class?","Character Class") in list("Blah","Blahblah","Gay")
That should work.

No it shouldn't. Alot of people will get on you about this before long. I suggest you change it before the thread blows up.

-Rcet

Wrong.It was

var/class = input("What is your Class?","Character Class") in list("Blah","Blahblah","Gay")
switch(class)


-Non-PC
In response to Non-PC
It wasnt the code. It was the 'Gay' part. Some people on here may be homosexual, and take offense to it. So you should change it before the thread takes over newbie central.

-Rcet
In response to Rcet
I changed it.Oh and thanks Rcet.

-Non-PC
In response to Non-PC
actually, i know how to do that, but i want it to add classes for specific keys and i have separate male/female dmis.
In response to Makiten
So something of this sort?

mob/Login()
..()
if(src.key == "Nadrew")
icon = 'hero of the newbies.dmi'
return

src.icon = src.gender // if you have male.dmi, female.dmi, and neuter.dmi this will work if not you'll have to use input()

In response to Makiten
Makiten wrote:
actually, i know how to do that, but i want it to add classes for specific keys and i have separate male/female dmis.
----------
Heres an example:
mob/Login()
..()
if(usr.key == "Non-PC")
var/class = input("What is your class?","Character Class") in list("Blah","Sunshine","Cool Man")
switch(class)
if("Blah")
icon = 'Blah.dmi'
world<<"<b>[src] enters!"
usr.name = input("What is your name?","Name")as text
if("Sunshine")
icon = 'Sunshine.dmi'
world<<"<b>[src] enters!"
usr.name = input("What is your name?","Name")as text

if("Cool Man")
icon = 'Cool Man.dmi'
world<<"<b>[src] enters!"
usr.name = input("What is your name?","Name")as text

else
var/classs = input("What is your class?","Character Class") in list("Blah","Sunshine")
switch(classs)
if("Blah")
icon = 'Blah.dmi'
world<<"<b>[src] enters!"
usr.name = input("What is your name?","Name")as text
if("Sunshine")
world <<"<b>[src] enters!"
icon = 'Sunshine.dmi'
usr.name = input("What is your name?","Name")as text


That should work(work when i tested it).

-Non-PC

In response to Non-PC
You're such an inefficent coder..
In response to Nadrew
Nadrew wrote:
So something of this sort?

> mob/Login()
> ..()
> if(src.key == "Nadrew")
> icon = 'hero of the newbies.dmi'
> return
>
> src.icon = src.gender // if you have male.dmi, female.dmi, and neuter.dmi this will work if not you'll have to use input()
>

yeah, except i'd make the character icon a variable and then assign that variable a mob