was working perfectly
I did not modify this part of the code
I modified other parts
now is giving this error
I don't know what to do
can anyone help me?
[DOUBLEPOST=1426531538][/DOUBLEPOST]Config[ID64] //error is hereCode:[ChatCommand("cash")] void chatCash(BasePlayer player, string command, string[] args) { SendReply(player, String.Concat("Seu cash atual e: ", Convert.ToString(ObterCash(player)))); } int ObterCash(BasePlayer player) { string ID64 = player.userID.ToString(); var menu = Config[ID64] as Dictionary<string, object>;//->the error is here next if (menu != null) { object value; menu.TryGetValue("cash", out value); int cash = Convert.ToInt32(value); if (cash > 0) { return cash; } else { RemoveCash((BasePlayer)player); return 0; } } else { return 0; } }
[DOUBLEPOST=1426555983,1426530125][/DOUBLEPOST]I found the solution
I will leave here for if someone has the same problem
I mechi in another callback code and removed the
LoadConfig ();
just added it and problem solved
Solved [C#] Object reference not set to an instance of an object
Discussion in 'Rust Development' started by igor1150, Mar 17, 2015.