how to get a player gender?
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
how to get a player gender?
I need to make a script that determines the gender of the player and then executes the command. For example, if the player's gender is male, then he executes a command, if female, then executes another command.
0 x
Hello world
- Odex64
- Superfighter
- Posts: 172
- Joined: Sat Jul 29, 2017 12:39 pm
- Title: Content Creator
- SFD Account: Odex64
- Started SFD: PreAlpha
- Location: Italy
- Gender:
- Age: 22
Female skin and clothes end with "_fem" suffix. To check if a player is using a female or male skin, you can use the following code:
Let me know if it works; I haven't tested it.
Code: Select all
public void ButtonPressed(TriggerArgs args)
{
if (args.Sender is IPlayer)
{
IPlayer ply = (IPlayer)args.Sender;
if (ply.GetProfile().Skin.Name.Split('_').Length > 1)
{
//female
}
else
{
//male
}
}
}
2 x