I am a new rust plugin dev and im looking for some help when I do /servermessage nothing comes up and i get a error saying that failed to call hook and that index out of range. Everything else works.
using Oxide.Core;
using Oxide.Core.Configuration;
using Oxide.Game.Rust.Cui;
using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("Test Rust Plugin", "Gunter", "0.0.1")]
public class TestRustPlugin : RustPlugin
{
//On Plugin Loaded
private void Loaded()
{
permission.RegisterPermission("TestRustPlugin.use", this);
}
//Commands
[ChatCommand("servermessage")]
void cmdServerMessage(BasePlayer player, string cmd, string[] args)
{
string shoutstring = args[0];
if (permission.UserHasPermission(player.UserIDString, "TestRustPlugin.use"))
{
Server.Broadcast(shoutstring);
}
if (shoutstring.Length < 1)
{
rust.SendChatMessage(player, "Broadcast", "Syntax: /ServerMessage <message>");
}
}
}
}