1. Hiya,

    I'm trying reply to a player when they type in a chat command - the code I've got is below:

    Code:
        OnPlayerChat: function(arg) {        ...some code happened here...        if ('heli add' == message) {
                this.HeliAdd(arg.connection.player);
                return true;
            }    },    HeliAdd: function(player) {        ...some code happened here...       if (undefined != reply) {
                timer.Once(1, function() {
                    HeliQueue.DoReply(player, reply);
                });
           }    },    DoReply: function(player, reply) {        player.Reply(reply);    }
    The error is below:

    Code:
    [12/10/2016 20:43:45] [Oxide] 20:43 [Error] Failed to run a 1.00 timer
    File: HeliQueue.js Line: 415 Column: 2 TypeError Object has no method 'Reply':
      at Jint.Native.Function.ScriptFunctionInstance.Call (JsValue thisArg, Jint.Native.JsValue[] arguments) [0x00000] in <filename unknown>:0
      at (wrapper delegate-invoke) System.Func`3<Jint.Native.JsValue, Jint.Native.JsValue[], Jint.Native.JsValue>:invoke_JsValue__this___JsValue_JsValue[]
    Any help getting this working would be greatly appreciated.

    T.
     
  2. Wulf

    Wulf Community Admin

    player.Reply is for Oxide's Covalence API only. For Rust, you'd need to use rust.SendChatMessage(player, "message") or player.ChatMessage("message").
     
  3. Thanks for the quick reply, as always :)

    I tried rust.SendChatMessage(player, "message") and gave it a go - can't see the results myself right now but I asked in chat if everyone saw the result and it seems they did (it is very likely the players were lying to me though). I'll check this myself and reply tomorrow...

    Can't trust Rust players to give a straight answer :/
     
  4. That worked perfectly btw - my players were lying to me :/

    No chance someone could write a truth plugin that detects lies and kicks a player if caught...? :)