Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How do i check players sex?


Fragment
 Share

Recommended Posts

Im trying to get the paperdoll system to blt a different image depending on the sex
I want to do this (psuedo code)

If [player.sex = male]
Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
else
If [player.sex = female]
Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdollf, Anim, spritetop)

what goes in the [] or do i need to send the sex from the server to do this?
Link to comment
Share on other sites

```
If Player(Index).Sex = SEX_MALE Then
    Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
ElseIf Player(Index).Sex = SEX_FEMALE Then
    Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
End If
```
@Antisora:

> I do not know

Congrats on being no help whatsoever.
Link to comment
Share on other sites

@Fragment:

> gave me an error to do with method or data member not found, highlighting the sex… this might be a problem on my side though

Make sure this is in modConstants:

```
Public Const SEX_MALE As Byte = 0
Public Const SEX_FEMALE As Byte = 1
```
Link to comment
Share on other sites

@Fragment:

> That was in my modconstant, i still get the error.

Oh, I see now, "Sex as Byte" isn't sent to the client usually. (Seeing as it isn't really needed at all.) Just make sure you send it to everyone online when the player logs in. Remember to add "Sex As Byte" to the PlayerRec UDT. (Client-side)
Link to comment
Share on other sites

Ok thanks, however, i have now found a work around… it relies on the fact that the players sprite is gender based and not class based though and it means that every paperdoll MUST have 2 images.

However, this essentially allows gender based paperdoll (or atleast sprite based):

                If Sprite = 1 Then
                    Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll, Anim, spritetop)
                ElseIf Sprite = 2 Then
                    Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(i))).Paperdoll + 1, Anim, spritetop)
                End If

I am going to post this in tutorials for everyone else who has been looking for this, hopfully someone will help improve this by explaining how to allow the user to set it in the item editor.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...