I've recently made changes to a simple help plugin that I somewhat created myself, but the console outputs this error when trying to load.
Not really sure where the error is originating from and any help fixing it would be appreciated. As a disclaimer, not all of the code here was done by me, I simply used some from other scripts.Code:[Oxide] 13:02 [Error] Error while compiling HelpText.cs(121,41): error CS1503: Argument `#2' cannot convert `System.Collections.Generic.List<string>' expression to type `string'
Code:using System.Text.RegularExpressions; using System.Collections.Generic; using Oxide.Game.Rust.Libraries; using Newtonsoft.Json.Linq; using Oxide.Core.Plugins; using Newtonsoft.Json; using UnityEngine; using System.Linq; using Oxide.Core; using System;namespace Oxide.Plugins { [Info("Help Text", "Alpha Toon", "1.0.1")] class HelpText : RustPlugin { [ChatCommand("help")] private void HelpCommand(BasePlayer player, string command, string[] args) { if (EnableCommandText) { List<string> CommandsList = ConvertList(Config.Get("Commands")); foreach (string line in CommandsList) SendMessage(player, CommandsList); } } [ChatCommand("rules")] private void RulesCommand(BasePlayer player, string command, string[] args) { if (EnableRulesText) { List<string> RulesList = ConvertList(Config.Get("Rules")); foreach (string line in RulesList) SendMessage(player, line); } } [ChatCommand("donate")] private void DonateCommand(BasePlayer player, string command, string[] args) { if (EnableDonationText) { List<string> DonationList = ConvertList(Config.Get("Donations")); foreach (string line in DonationList) SendMessage(player, line); } } } }
Solved Need help fixing a script error
Discussion in 'Rust Development' started by Alpha Toon, Dec 2, 2016.
-
Wulf Community Admin
The error says line 121, have you looked on that line?
-
I did initially look at the lines, but I couldn't figure out what was wrong with it. But after re looking at the code, I realized that I shouldn't have line used for each command so I renamed each one to something relevant to the code/command. Could you please lock this thread.
