ID:146304
 
Code:
mob
player
if(client.gender == "male")
icon = 'Male Test Icon.dmi'
density = 1
if(client.gender == "female")
icon = 'Female Test Icon.dmi'
density = 1


Problem description:
I cant seem to find a way to make the icon depend on the player's gender =\, is there anyway to read that from a players key?

mob
player
Login()
if(client.gender == "male")
icon = 'Male Test Icon.dmi'
if(client.gender == "female")
icon = 'Female Test Icon.dmi'
density=1


This should solve your problems.
In response to ManDroid13
meh, dont forget to add ..()
In response to Cheetoz
Thanks for the help ;)

PS: I didnt get to the density part yet
In response to Cheetoz
I was going to but then I stopped and thought that it might call the proc a second time.
In response to ManDroid13
ManDroid13 wrote:
mob
> player
> Login()
> if(client.gender == "male")
> icon = 'Male Test Icon.dmi'
> if(client.gender == "female")
> icon = 'Female Test Icon.dmi'
> density=1
>

This should solve your problems.

The reason being, of course, that if() statements cannot be used outside of proc's. if() statements run a check, which can't really be done at compile-time.

Also, mobs are defaultly dense, I do believe. I don't really see the point in setting density at Login(), but whatever floats your boat.
In response to SimpleLiver
Quote: that if() statements cannot be used outside of proc's.

That's not true.
They can be used in verbs.
(i couldn't quite understand what you said there)

(and Login() is a proc in itself.)

I believe you would do..
mob
player
Login()
if(src.gender == "male")
icon = 'Male Test Icon.dmi'
if(src.gender == "female")
icon = 'Female Test Icon.dmi'
density=1


Because gender I believe, is a mob based variable, and I think it's automaticly set everytime you login.