Hello,
I was wondering if someone could help me with abit of trouble that I have come across.
I have tried to modify a plugin (CompassGUI , Created by paiN) to show the player's current economy balance.
I am not too sure how I tell the plugin to get the data from economy and display the player's current balance.
I looked at the economy script and how it displayed the player's balance when the command /balance was entered. But the plugin that I am modifying is using C# not .lua
I entered this return ("$(" + playerMoney[1] + ") ", API.GetUserDataFromPlayer(player));
into the String GetPlayerBalance but oxide keeps returning an error
Can someone please help me understand how to make this plugin work?Code:7:32 PM [Info] Unloaded plugin PlayerBalanceGUI v0.1.0 by PaiN/Ownage427 7:32 PM [Error] Unable to load PlayerBalanceGUI. PlayerBalanceGUI.cs(20,9): error CS0246: The type or namespace name `plugin' could not be found. Are you missing an assembly reference? & 7:33 PM [Error] PlayerBalanceGUI plugin failed to compile! 7:33 PM [Error] PlayerBalanceGUI.cs(20,9): error CS0246: The type or namespace name `plugin' could not be found. Are you missing an assembly reference?
Cheers,
Mark
Help with my GUI for economy
Discussion in 'Rust Development' started by Ownage427, Jul 21, 2015.
-
Attached Files:
Last edited by a moderator: Jul 21, 2015 -
-
Calytic Community Admin Community Mod
Taken from one of my personal plugins..
in Loaded..Code:private Core.Configuration.DynamicConfigFile Economy;
In your method to get credits..Code:this.Economy = Interface.GetMod().DataFileSystem.GetDatafile("Economics");
Code:object econ = null; if (this.Economy != null) { econ = this.Economy[playerID]; if (econ is List<object>) { List<object> econData = econ as List<object>; credits = Convert.ToSingle(econData[0].ToString()); } } -
The economy api is made for Lua.
I will convert economy to .cs soon, so you will have normal api) -
Thanks Calytic for the code that you have submitted!
I have a idea of what I need to do now,
but I will wait for Bombardir to update the plugin to c#
Cheers guys,
Mark
