Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added /say cmd #188

Merged
merged 2 commits into from
Jun 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ g_PluginInfo =
HelpString = "Saves all worlds.",
},

["/say"] =
{
Permission = "core.say",
Handler = HandleSayCommand,
HelpString = "Sends a message in the chat to other players.",
},

["/seed"] =
{
Permission = "core.seed",
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Implements some of the basic commands needed to run a simple server.
# Commands

### General

| Command | Permission | Description |
| ------- | ---------- | ----------- |
|/ban | core.ban | Bans a player.|
Expand All @@ -29,6 +30,7 @@ Implements some of the basic commands needed to run a simple server.
|/regen | core.regen | Regenerates a chunk.|
|/reload | core.reload | Reloads all plugins.|
|/save-all | core.save-all | Saves all worlds.|
|/say | core.say | Sends a message in the chat to other players.|
|/seed | core.seed | Shows the seed of the given world name or current world, if not given.|
|/setspawn | core.setspawn | Changes the world's spawn point.|
|/spawn | core.spawn | Returns a player to the spawn point.|
Expand Down Expand Up @@ -60,6 +62,7 @@ Implements some of the basic commands needed to run a simple server.


# Permissions

| Permissions | Description | Commands | Recommended groups |
| ----------- | ----------- | -------- | ------------------ |
| core.ban | | `/ban` | |
Expand All @@ -86,6 +89,7 @@ Implements some of the basic commands needed to run a simple server.
| core.regen | | `/regen` | |
| core.reload | | `/reload` | |
| core.save-all | | `/save-all` | |
| core.say | | `/say` | |
| core.seed | | `/seed` | |
| core.setspawn | | `/setspawn` | |
| core.spawn | | `/spawn` | |
Expand Down
9 changes: 9 additions & 0 deletions chat.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function HandleSayCommand(Split, Player)
if (Split[2] == nil) then
SendMessage(Player, "Usage: " ..Split[1].. " <message ...>")
return true
end

cRoot:Get():BroadcastChat("[" .. Player:GetName() .. "] " .. table.concat(Split, " ", 2))
return true
end