That and maybe parts of their body, like eye color, chest, groin size, etc...?
Solved Is there anyway to change a players gender?
Discussion in 'Rust Development' started by Caffeine, Jul 22, 2016.
-
Wulf Community Admin
-
Great thank you Wulf, I searched ahead of time but didn't manage to find those threads.
-
Wulf Community Admin
-
Out of curiosity do you know why doing
player.playerModel.skinType = 1;
makes the plugin crash? It's a public int, and code below in Assembly-CSharp.dll has
Code:public bool IsFemale { get { return this.skinType == 1; } }
-
Wulf Community Admin
-
Code:
[ChatCommand("gender")] void cmdGender(BasePlayer player, string command, string[] args) { player.playerModel.skinType = 1; //player.playerModel.visible = false; Puts("issued"); }
Error output
Code:[Oxide] 01:07 [Error] Failed to call hook 'cmdGender' on plugin 'GenderChanger v1.0.0' (NullReferenceException: Object reference not set to an instance of an object) [Oxide] 01:07 [Debug] at Oxide.Plugins.GenderChanger.cmdGender (.BasePlayer player, System.String command, System.String[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.GenderChanger.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
-
Wulf Community Admin
Not much you can do if it's null, perhaps it's a private field and needs reflection though? -
Is public https://dl.dropboxusercontent.com/u/50354233/public.png and I tried reflection as well, same error. I guess i'll try out the server command instead.