ID:144353
 
Code:
turf
hair
icon = 'hair.png'
density = 1
layer = 21
Click()
var/mob/M=usr
if(!M) return
if(M.hairselected == 1)
M<<"<font size=1><font color = purple><b>Your current hair has been deleted.</b></font>"
M.Gethair()
if(M.hairselected == 0)
M.Gethair()

mob
proc
Gethair()
var/hairoptions = list("bald","bald2","bald3")
var/hairchoice = input(hairoptions)
var/mob/M=usr
if(!M) return
if(hairchoice == "bald")
M<<"you're bald"
if(hairchoice == "bald2")
M<<"you're bald2"
if(hairchoice == "bald3")
M<<"you're bald3"
M.hairselected = 1


Problem description:

Compiles fine, runtime error;

runtime error: bad client
proc name: Gethair (/mob/proc/Gethair)
usr: CYN (/mob)
src: CYN (/mob)
call stack:
CYN (/mob): Gethair()
the hair (23,14,2) (/turf/hair): Click(the hair (23,14,2) (/turf/hair))
You incorrectly used the input proc and gave it an invalid recipient.

This is a better version:
turf
hair
icon='hair.png'
density=1
layer=21 // ?
Click()
if(usr.hairselected) //this is a boolean. booleans do not need "==0" and "==1" and should be written like this
usr<<"<font size=1><font color = purple><b>Your current hair has been deleted.</b></font>"
usr.Gethair()

mob
proc
Gethair()
var/x=input(src,"Please select your new hairstyle.")in list("bald","bald2","bald3")
src<<"you're [x]"
src.hairselected=1


I'd prefer this one:

mob
Login()
.=..()
setHair()
var
list/Overlays
list/Underlays
hair_style="bald"
hair_color=rgb(0,0,0)
tmp //temporary variable (will not save)
image/hair
verb
change_hair_style()
var/x=input(usr,"Please select your new hairstyle.\nWarning: This will reset your hair color.","Change Hair Style")as null|anything in list("Bald","Bald #2","Bald #3")
if(x) hair_style=x
change_hair_color()
//this is very very basic. may want to make up your own system which gives you a preview of the color\
bear in mind that rgb() simply turns rgb->hex, giving you a standard HTML font color

var/r=input(usr,"How much red would you like in your hair?","Change Hair Color")as null|num
if(!r) return
var/g=input(usr,"How much green would you like in your hair?","Change Hair Color")as null|num
if(!g) return
var/b=input(usr,"How much blue would you like in your hair?","Change Hair Color")as null|num
var/color=rgb(r,g,b)
src<<"Your color will look like <font color=\"[color]\">this</a>." //you'll want to make this browser-based or something for more control
if(alert(usr,"Are you sure you would like this color?","Change Hair Color","No","Yes")=="Yes")
hair_color=color
setHair()
proc
getHairStyle()
switch(hair_style)
if("Bald") return icon('icons/hair/bald.dmi')
if("Bald #2") return icon('icons/hair/bald2.dmi')
if("Bald #3") return icon('icons/hair/bald3.dmi')
setHair()
var/icon/I=getHairStyle() //gets the icon for the corresponding hair style
if(I) //if we succeeded in obtaining this (and thus the hair_style variable is set to something we hardcoded)
I.Blend(hair_color)
if(!hair)
hair=image(I)
Overlays+=hair
else hair.icon=I
else if(hair) del hair

checkOverlays() //edit the overlays
checkOverlays()
overlays= Overlays?(Overlays.Copy()):null
underlays= Underlays?(Underlays.Copy()):null

world/cache_lifespan=0 //don't store anything new (like different hair colors) in the .rsc file preventing corruption of it later on, which may have a pwipe as an effect


Albeit not using your same method of clicking the hair itself, it does provide you with a clean and efficient way of changing your hair style and even colorize your hair.
In response to Android Data
Thanks I fixed it.