1. Code:
    class Broadcaster:
        def __init__(self):
            self.Title = "Broadcaster"
            self.Description = "Easyily Broadcast anything"
            self.Author = "NoSharp"
            self.Version = V(0, 1, 0)    def Init(self):
            permission.RegisterPermission("broadcaster.can", self.Plugin)
            command.AddChatCommand("Broadcast", self.Plugin, "B")
               
        def B(self,player, server, cmd, args):
            if userhasPermission("broadcaster.can"):
                rust.SendChatMessage(server, args[0])
            else:
                rust.SendChatMessage(player, "you have no permissions!")
     
  2. Wulf

    Wulf Community Admin

    There is nothing called "userhasPermission", you'd need to use a valid method and actually pass the player's ID to it.

    Example:
    Code:
    permission.UserHasPermission(player.UserIDString, "broadcaster.can")
    Also, only passing args[0] will only catch the first word provided unless the user adds quotes around it when using the command.

    If you can provide errors when posting, those will be helpful as well.

    Also, I'm not sure if you plan on submitting the final plugin, but there are already a few plugins that do what you are trying to do such as http://oxidemod.org/plugins/better-say-command.998/.
     
  3. Chat commands in Python take 4 args. Those are self, player, cmd, args. You'll need to either look at the documentation or the Oxide GitHub for the correct methods to use when checking for things like permissions and what arguments those methods take.

    To send a message to the server, use the rust.BroadcastChat(string chatname, string message) method.
     
  4. Still not :(
     
  5. What does your code look like?
     
  6. Syntax error unexpected token chatname
    [DOUBLEPOST=1469722665][/DOUBLEPOST]class Broadcaster:
    def __init__(self):
    self.Title = "Broadcaster"
    self.Description = "Easyily Broadcast anything"
    self.Author = "NoSharp"
    self.Version = V(0, 1, 0)

    def Init(self):
    permission.RegisterPermission("broadcaster.can", self.Plugin)
    command.AddChatCommand("Broadcast", self.Plugin, "B")

    def B(self,player, cmd, args):
    if permission.UserHasPermission(player.UserIDString, "broadcaster.can"):
    rust.BroadcastChat(string chatname, string message)
    else:
    rust.SendChatMessage(player, "you have not got permissions to use this!")
     
  7. "string chatname" and "string message" are just placeholders for the function. They're telling you what should go there. Change it to:
    Code:
    rust.BroadcastChat("MyServer", "This is a broadcast!")
     
  8. Wulf

    Wulf Community Admin

    You don't need the prefix/chatname, most plugins don't send one as it generally looks cleaner without.
     
  9. Thanks,
    Do you mind if i make my plugin public but give credit?
     
  10. Wulf

    Wulf Community Admin

    I'd recommend getting a bit more familiar with plugin development before trying to support a released one. As I mentioned before, there are other plugins that already handles this too. Your plugin in it's current state would need other changes before it would be approved here as well.
     
  11. ok thank you :D