Hi there,i'm looking for the command to get the player gender,
i remember that when i tested byond for the first time,
there's a command to get the player gender,but i have forgot it.
What's the code to get the player gender?
Edit:Edited to change sex to gender.
ID:155463
![]() Jun 29 2011, 4:15 am (Edited on Jun 29 2011, 9:19 pm)
|
|
There's also a built in variable which is called gender.
|
Yeah,is that,the gender,is that i have forget it,
last time i used this program,was a 4 years,and i have forget. Edit:Now i have know that to get the player gender,is to input gender,on lowercase. Thanks for the help. |
No offence...all you've done on these forums is ask for help. You normally don't give people code?...I'm sorry, I just got a chuckle out of that. You should probably keep it that way, considering this is only the first 10 days that you could have possibly had to start learning from a recent forum post requesting all to be done for you.
@OP: Gender Just check in Client/New() if they are male or female. client/New() |
OrangeWeapons wrote:
No offence...all you've done on these forums is ask for help. You normally don't give people code?...I'm sorry, I just got a chuckle out of that. You should probably keep it that way. Yeah, me too. I was just waiting so someone else could reply first. |
OrangeWeapons wrote:
No offence...all you've done on these forums is ask for help. You normally don't give people code?...I'm sorry, I just got a chuckle out of that. You should probably keep it that way, considering this is only the first 10 days that you could have possibly had to start learning from a recent forum post requesting all to be done for you. > client/New() You're weird. And i wondered that this forum area was to ask help,and i can't help peoples if i don't know so much about the program i'm using,so,i must learn first,to help in the forums. And i wonder that anybody here has her times of ask for help in the forums too. Edit:And thanks for the help. |
King_ed wrote:
I normaly give them a guide to read..... Guide? Are you talking about that guide that you never read yourself? |
King_ed wrote:
np glad to help Oh sorry,i didn't have read the rest of the post, i'm doing a rpg,that will have male and female characters,and lots of character classes,with unique skills and etc, but sorry,i can't give any other information of my game on this topic. |
Lugia319 wrote:
Indentation errors? Is that the best you could come up with? Indentation errors, usr abuse, generic ripped narto code. |
Question.. Wouldnt it be easier just to make a proc called Gender?
mob proc Gender() switch(input(usr,"Please choose your Gender","Gender")in list("Male","Female")) if("Male") usr.Gender="Male" if("Female") usr.Gender="Female" |
By default, when a new mob is made for a player (in client.New()), the new mob gets the same name and gender as the player's key.
|
Liight wrote:
Um i used usr and it still worked well. It's bad practice to use usr if it can be avoided, as usr can easily end up being null for a variety of reasons. A better way of doing it would be to pass the player as an argument to the proc to avoid null usr issues. Something like: proc/Gender(mob/M) switch(input(M,"Please choose your Gender","Gender")in list("Male","Female")) if("Male") M.Gender="Male" if("Female") M.Gender="Female" And call it with Gender(mob being given a gender) |
mob
Login()
usr.icon_state = input("Sex?") in list("male","female")
usr.Move(locate(1,1,1))//location you go to on login
I had no space to put whole code in right order but this is how u do it, i will only use part of each line.
mob
Login()
usr.icon_state = input("What gender?") usr.Move(locate(1,1,1))
You may notice some code is in wrong place, I done this on purpose so that it makes you think and not copy and paste the code.