Difference between revisions of "GetSex"
From UODemo Wiki
Line 8: | Line 8: | ||
Because the return value 0 indicates both a male or an invalid object/mobile you should use the [[isMobile]] function in your scripts to ensure that the object is valid!<br> | Because the return value 0 indicates both a male or an invalid object/mobile you should use the [[isMobile]] function in your scripts to ensure that the object is valid!<br> | ||
− | Because ghosts have a body type of 402 or 403 you | + | Because ghosts have a body type of 402 or 403 you should not use this function on player ghosts to determine the sex. |
Return to the [[Command List]]. | Return to the [[Command List]]. |
Latest revision as of 20:56, 24 November 2012
integer getSex(object Mobile);
The getSex function will return the sex of a mobile. The returned value can be 0, 1 or 2.
0: the given object is not a valid mobile or is a valid mobile and has a male body type (400)
1: the given object is a valid mobile and has a female body type (401)
2: the given object is a valid mobile but does not have a male nor a female body type
Because the return value 0 indicates both a male or an invalid object/mobile you should use the isMobile function in your scripts to ensure that the object is valid!
Because ghosts have a body type of 402 or 403 you should not use this function on player ghosts to determine the sex.
Return to the Command List.