My code looks like this right now ( yeah I just started with writing C#):
at the error message is:Code:void OnPlayerInit(BasePlayer player) { button.onClick.AddListener(() => DoSomething(player, 1)); CommunityEntity.ServerInstance.ClientRPCEx( new Network.SendInfo() { connection = player.net.connection }, null, "AddUI", json.Replace("{something}", "Hi") ); } public void DoSomething(BasePlayer player, int number) { // follow <.< }
I just figured out I could be with the player object. I really don't know how to check which player clicked which button to give this info to another function to set it then in the storedData ( < that's not the problem ).Code:[Oxide] 2:27 PM [Debug] at Oxide.Plugins.DoSomething.OnPlayerInit (.BasePlayer player, System.String cmd, System.String[] args) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Solved OnClick Button handle to overgive player object to another function
Discussion in 'Rust Development' started by Splak, Sep 26, 2015.