1. hi, need convert C# to lua
    or from Lua to call a function in C#
    Code:
    using UnityEngine;
    using Rust;namespace Oxide.Plugins
    {
        class Interface : RustPlugin
        {
            private void gui_test(BasePlayer player, string json)
            {
                CommunityEntity.ServerInstance.ClientRPCEx(new Network.SendInfo() { connection = player.net.connection }, null, "AddUI", json);
            }
        }
    }
     
    Last edited by a moderator: Jun 8, 2015
  2. The forum is not dead, you are just not a patience person when waiting for help. As for your questions you just need to call it like you would in lua with a few differences. I would advise if you are creating anything GUI related to use C# and not one of the other supported languages.
     
  3. Forgive my impatience, I had hoped to resolve the issue today
    I have tried this option, but he swears that the arguments are not correct.
    Code:
    CommunityEntity.ServerInstance.ClientRPCEx(player.connect, nil, "AddUI", json);
    But it has not brought results.
    [DOUBLEPOST=1433734370,1433698791][/DOUBLEPOST]I want to believe that the forum is not dead = ( I really want to believe.
     
  4. Wulf

    Wulf Community Admin

    Not everyone will instantly have an answer for you, this isn't an instant support chat, it's a forum supported by volunteers and community members. It's also as weekend, where many of us have probably been away doing other things for the day. We need breaks sometimes too!
     
  5. Because the arguments are not correct! You need the Network.SendInfo() object as the first arg.

    You can use: sendinfo = new( Network.SendInfo._type , nil )
    sendinfo.connection = player.net.connection
    CommunityEntity.ServerInstance.ClientRPCEx(sendinfo, nil, "AddUI", json)
     
  6. Once again I apologize for my impatience. Just I am hoping to do this quickly but alas, I did not know how to announce a class in Lua. Now I'll know)) In general, I would like to become oxide developer and for that I have a good knowledge of C #. But I do not quite understand how it works himself oxide, and can be simply understood. Here we assume you have a class Mysql as I understand it does everything in the parent stream, and in any case expect a response from the database. I have a method that podruzomivaet different options.

    Here is an example in PHP:
    Code:
    $Mysql->query('INSERT INTO `accounts` (`username`,`steamid`,`password`,`lastdate`) VALUES (?s,?i,?s,NOW())', $login,$stamid,$pass);
    $Res = $Mysql->getRow('SELECT `accounts`.*,`accounts_access`.`access_level` FROM `accounts` LEFT JOIN `accounts_access` ON (`accounts`.`steamid`=`accounts_access`.`steamid`) WHERE `steamid`=?i',$steamid);
    $Res = $Mysql->getAll('SELECT `accounts`.*,`accounts_access`.`access_level` FROM `accounts` LEFT JOIN `accounts_access` ON (`accounts`.`steamid`=`accounts_access`.`steamid`)');
    $OnlineUsers = $Mysql->getOne('SELECT COUNT(*) FROM `accounts` WHERE `lastdate` > NOW() - INTERVAL 1 MINUTE');
    This method query performed in a separate thread, and does not affect the course of the program because it does not expect a response from the server.

    If I put all the libraries from the official library MYSQL, Can I write a plug-in C # that would interact with it?
    [DOUBLEPOST=1433738688][/DOUBLEPOST]https://dev.mysql.com/downloads/connector/net/6.9.html
     
    Last edited by a moderator: Jun 8, 2015
  7. You should be using the MySQL extension for database calls. There are a few examples on the forums. I'm on mobile so I can't search for them.
     
  8. Help! Example PLEASE! Easy Example!

    C#:
    namespace Oxide.Plugins
    public class DevPluge : RustPlugin
    public void Log(string message)

    need use DevPluge.Log("Hallo world"); Tongue lua