1. where I made a mistake?

    Code:
    [Oxide] 19:26 [Error] SMSPlugin plugin failed to compile!
    [Oxide] 19:26 [Error] SMSPlugin.cs(19,30): error CS0234: The type or namespace name `MySql' does not exist in the namesp
    ace `Oxide.Ext'. Are you missing an assembly reference?
    Code:
    using System.IO;
    using System.Collections.Generic;
    using Oxide;
    using Oxide.Core;
    using System.Text;namespace Oxide.Plugins
    {
        [Info("test", "Unknown", 0.1)]
        [Description("test")]    public class test: HurtworldPlugin
        {        private readonly Ext.MySql.Libraries.MySql _mySql = Interface.GetMod().GetLibrary<Ext.MySql.Libraries.MySql>();
            private Core.Database.Connection _mySqlConnection;
            private const string InsertData = "INSERT INTO shop (`nick`, `ranga`, `data`) VALUES (@0, @1, @2);";
            private const string SelectData = "SELECT `nick`, `ranga`, `data` FROM shop;";        private void Init()
            {            Puts("Logowanie do bazy danych");
                _mySqlConnection = _mySql.OpenDb("localhost", 3306, "hurt", "root", "***********", this);            var sql = Core.Database.Sql.Builder.Append(@"DROP TABLE IF EXISTS shop;
                                     CREATE TABLE IF NOT EXISTS shop (
                                     id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
                                     data VARCHAR(100),
                                     data_other INT
                                   );");            var r = new System.Random();            for (var i = 0; i < 10; i++)
                {
                    var rInt = r.Next();
                    sql.Append(InsertData, "test" + rInt, rInt);
                }
                _mySql.Insert(sql, _mySqlConnection);            sql = Core.Database.Sql.Builder.Append(SelectData);
                _mySql.Query(sql, _mySqlConnection, list =>
                {
                    if (list == null) return;
                    var sb = new StringBuilder();
                    sb.AppendLine();
                    sb.AppendLine(" id\tdata\t\tdata_other");
                    foreach (var entry in list)
                    {
                        sb.AppendFormat(" {0}\t{1}\t{2}", entry["id"], entry["data"], entry["data_other"]);
                        sb.AppendLine();
                    }
                    Puts(sb.ToString());
                });
            }
     
  2. Wulf

    Wulf Community Admin

    You need to add using Oxide.Ext.Mysql; and using Oxide.Core.Database; to the top.