Skip to content

Commit 1a064f2

Browse files
fix: update user messages
1 parent 38b87b6 commit 1a064f2

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Allow players to automatically try and unlock locked code locks with their code.
1010
## Permissions
1111

1212
- `autocode.use` - Allows use of this plugin.
13-
- `autocode.try` - Allows auto-trying of user code on locked code locks.
13+
- `autocode.try` - Allows auto-trying of user auto-code on locked code locks.
1414
- `autocode.admin` - Allows use of admin commands.
1515

1616
## Chat Commands
@@ -19,18 +19,18 @@ Allow players to automatically try and unlock locked code locks with their code.
1919

2020
*You* refers to the player running the command.
2121

22-
- `/code 1234` - Sets your code to 1234.
23-
- `/code pick` - Opens the code lock input for you to enter a code.
24-
- `/code random` - Sets your code to a random code.
25-
- `/code remove` - Removes your set code (and guest code).
22+
- `code 1234` - Sets your auto-code to 1234.
23+
- `code pick` - Opens the code lock interface for you to set your auto-code.
24+
- `code random` - Sets your auto-code to a random code.
25+
- `code remove` - Removes your set auto-code (and guest auto-code).
2626

2727
The core commands are also avalibale in a guest code version. e.g.
2828

29-
- `/code guest 5678` - Sets your guest code to 5678.
29+
- `code guest 5678` - Sets your guest code to 5678.
3030

3131
### Other Commands
3232

33-
- `/code quiet` - Toggle quiet mode. In this mode less messages will be displayed and your code will be hidden.
33+
- `code quiet` - Toggle quiet mode. In this mode less messages will be displayed and your auto-code will be hidden.
3434

3535
## Console Commands
3636

src/AutoCode.cs

+21-6
Original file line numberDiff line numberDiff line change
@@ -1073,10 +1073,14 @@ private void ShowInfo(BasePlayer player, string label, string[] args)
10731073
plugin.Message(
10741074
player,
10751075
string.Format(
1076-
plugin.lang.GetMessage("Info", plugin, player.UserIDString),
1077-
code ?? plugin.lang.GetMessage("NotSet", plugin, player.UserIDString),
1078-
guestCode ?? plugin.lang.GetMessage("NotSet", plugin, player.UserIDString),
1079-
UsageInfo(label)
1076+
"{0}\n\n{1}",
1077+
string.Format(
1078+
plugin.lang.GetMessage("Description", plugin, player.UserIDString),
1079+
code ?? plugin.lang.GetMessage("NotSet", plugin, player.UserIDString),
1080+
guestCode ?? plugin.lang.GetMessage("NotSet", plugin, player.UserIDString),
1081+
plugin.lang.GetMessage(quietMode ? "Enabled" : "Disabled", plugin, player.UserIDString)
1082+
),
1083+
GetHelp(player, label)
10801084
)
10811085
);
10821086
}
@@ -1090,16 +1094,27 @@ private void SyntaxError(BasePlayer player, string label, string[] args)
10901094
player,
10911095
string.Format(
10921096
plugin.lang.GetMessage("SyntaxError", plugin, player.UserIDString),
1093-
UsageInfo(label)
1097+
GetUsage(label)
10941098
)
10951099
);
10961100
}
10971101

1102+
/// <summary>
1103+
/// Get help for the "use" command.
1104+
/// </summary>
1105+
public string GetHelp(BasePlayer player, string label)
1106+
{
1107+
return string.Format(
1108+
plugin.lang.GetMessage("Help", plugin, player.UserIDString),
1109+
GetUsage(label)
1110+
);
1111+
}
1112+
10981113
/// <summary>
10991114
/// Show how to use the "use" command.
11001115
/// </summary>
11011116
/// <returns></returns>
1102-
private string UsageInfo(string label)
1117+
private string GetUsage(string label)
11031118
{
11041119
return string.Format(
11051120
"/{0} <{1}>",

0 commit comments

Comments
 (0)