class test:
def __init__(self):
self.Title = "welcome"
self.Description = "welcome"
self.Author = "Aparent"
self.Version = V(1, 0, 0)
def Init(self):
command.AddChatCommand("test", self.Plugin, "TestCommand")
def TestCommand(self, cmd, args, player):
player.Reply("WE DID IT")
[DOUBLEPOST=1468494339][/DOUBLEPOST]Code:class test: def __init__(self): self.Title = "welcome" self.Description = "welcome" self.Author = "Aparent" self.Version = V(1, 0, 0) def Init(self): command.AddChatCommand("test", self.Plugin, "TestCommand") def TestCommand(self, cmd, args, player): player.Reply("WE DID IT :D")
Sending a message with Python?
Discussion in 'Rust Development' started by Serenity 3, Jul 14, 2016.
-
Because Reply is a method provided by ILivePlayer and the Python extension defaults to the Rust BasePlayer instead of the Covalence ILivePlayer.
-
So it would be:
Code:class test: def __init__(self): self.Title = "welcome" self.Description = "welcome" self.Author = "Aparent" self.Version = V(1, 0, 0) def Init(self): command.AddChatCommand("test", self.Plugin, "TestCommand") def TestCommand(self, cmd, args, player): BasePlayer.Reply("WE DID IT :D") -
No, you'll have to use Rust's messaging methods until Covalence support is added for the Python extension.
rust.SendChatMessage(player, "Prefix/Plugin name", msg) -
still nothing

Code:class test: def __init__(self): self.Title = "welcome" self.Description = "welcome" self.Author = "Aparent" self.Version = V(1, 0, 0) def Init(self): command.AddChatCommand("test", self.Plugin, "TestCommand") def TestCommand(self, cmd, args, player): rust.SendChatMessage(player, "test", msg) -
You obviously need to specify the message to send.
-
[DOUBLEPOST=1468503958][/DOUBLEPOST]stil nothingCode:
class test: def __init__(self): self.Title = "welcome" self.Description = "welcome" self.Author = "Aparent" self.Version = V(1, 0, 0) def Init(self): command.AddChatCommand("test", self.Plugin, "TestCommand") def TestCommand(self, cmd, args, player): rust.SendChatMessage(player, msg, "Prefix/Plugin name") -
Wulf Community Admin
The "msg" needs to come from somewhere. -
so like this
Code:class test: def __init__(self): self.Title = "welcome" self.Description = "welcome" self.Author = "Aparent" self.Version = V(1, 0, 0) def Init(self): command.AddChatCommand("test", self.Plugin, "TestCommand") def TestCommand(self, cmd, args, player, msg): rust.SendChatMessage(player(msg "Prefix/Plugin name")) -
Wulf Community Admin
No, you can't just make up new arguments.
The order is
wrong too, it'd be self, player, cmd, args.
The message and player comes from args, which you'd need to get from Rust. -
is there away of finding Rust Hooks?
-
Wulf Community Admin
They're all listed in the Docs at the top of the page. -
it says to use:
[DOUBLEPOST=1468510062][/DOUBLEPOST]but in the beginning i tried this to no availCode:def TestCommand(self, player, cmd, args): player.Reply("Test successful!") -
Wulf Community Admin
Code:def TestCommand(self, player, cmd, args): rust.SendChatMessage(player, "Test successful!") -
Thanks
i have been trying to fix it all day 
[DOUBLEPOST=1468510373][/DOUBLEPOST]SOLVED
