Difference between revisions of "GetSex"
From UODemo Wiki
(Created page with 'integer '''getSex'''(object ''Mobile'');<br> 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 mo…') |
|||
Line 3: | Line 3: | ||
The ''getSex'' function will return the sex of a mobile. The returned value can be 0, 1 or 2. | 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 ( | + | 0: the given object is not a valid mobile or is a valid mobile and has a male body type (400)<br> |
− | 1: the given object is a valid mobile and has a female body type ( | + | 1: the given object is a valid mobile and has a female body type (401)<br> |
2: the given object is a valid mobile but does not have a male nor a female body type<br> | 2: the given object is a valid mobile but does not have a male nor a female body type<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! | + | 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 cannot use this function on player ghosts. | |
Return to the [[Command List]]. | Return to the [[Command List]]. |
Revision as of 20:52, 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 cannot use this function on player ghosts.
Return to the Command List.