Skip to content

Commit 860a8b7

Browse files
committed
Adding Examples
1 parent 6e4f177 commit 860a8b7

File tree

10 files changed

+257
-12
lines changed

10 files changed

+257
-12
lines changed

Examples/CenterMessageWithColor.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"Title": "Center Message with color",
4+
"Description": "Center Message with color",
5+
"Command": "colorcenter",
6+
"CenterElement": {
7+
"CenterMessage": "<font color='#00ff00'>Cool color here</font>",
8+
"CenterMessageTime": 5 // Seconds
9+
},
10+
"PrintTo": 2
11+
},
12+
{
13+
// HTML is possible but not css or js
14+
"Title": "With html",
15+
"Description": "With html",
16+
"Command": "htmlcenter",
17+
"CenterElement": {
18+
"CenterMessage": "<div>Steam Group</div><br><div><font color='#00ff00'>https...</font></div>",
19+
"CenterMessageTime": 5 // Seconds
20+
},
21+
"PrintTo": 2
22+
}
23+
]

Examples/TagsAndColor.json renamed to Examples/Colors.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"Title": "Rainbow",
44
"Description": "rainbow command",
55
"Command": "rainbow",
6-
"Message": "{RED}R{LIGHTRED}AINBOW", // \n is a new line
6+
"Message": " {RED}R{ORANGE}A{YELLOW}I{GREEN}N{BLUE}B{DARKBLUE}O{PURPLE}W",
77
"PrintTo": 0
88
},
99
{
10-
"Title": "Colors",
11-
"Description": "Command for Discord",
10+
"Title": "All Colors",
11+
"Description": "This command displays all the colors that are available to use in the chat.",
1212
"Command": "colors",
1313
"Message": "{DEFAULT}1, {WHITE}2 \n {DARKRED}3, {RED}4, {LIGHTRED}5\n {GREEN}6, {LIME}7, {OLIVE}8\n {ORANGE}9, {GOLD}10, {YELLOW}11\n {BLUE}12, {DARKBLUE}13\n {LIGHTPURPLE}14 {PURPLE}15 \n, {GREY}18",
1414
"PrintTo": 0

Examples/NewLines.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Title": "Numbers",
1111
"Description": "From one to ten",
1212
"Command": "numbers",
13-
"Message": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10",
13+
"Message": "1\n2\n3\n4\n5\n6\n7\n8\n9\r\n10", // \n or \r is a new line
1414
"PrintTo": 0
1515
}
1616
]

Examples/Permissions.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[
2+
{
3+
"Title": "Ping",
4+
"Description": "Send back Pong! to the user",
5+
"Command": "ping",
6+
"Message": "Pong!",
7+
"PrintTo": 0,
8+
"Permission": {
9+
"RequiresPermissionOr": false, // true = Requires one of the permissions in the list | false = Requires all of the permissions in the list
10+
"PermissionList": [
11+
"@css/cvar", // normal css permissions
12+
"@custom/permission", // create your own permissions
13+
"#css/simple-admin" // needs to be in the simple-admin group
14+
]
15+
}
16+
}
17+
]

Examples/PrintTo.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
[
2+
{
3+
"Title": "Client Chat",
4+
"Description": "Client Chat message",
5+
"Command": "clientchat",
6+
"Message": "ClientChat",
7+
"PrintTo": 0
8+
},
9+
{
10+
"Title": "All Chat",
11+
"Description": "All Chat message",
12+
"Command": "allchat",
13+
"Message": "All Chat",
14+
"PrintTo": 1
15+
},
16+
{
17+
"Title": "Client Center",
18+
"Description": "Client Center message",
19+
"Command": "clientcenter",
20+
"CenterElement": {
21+
"CenterMessage": "Client Center",
22+
"CenterMessageTime": 5 // Seconds
23+
},
24+
"PrintTo": 2
25+
},
26+
{
27+
"Title": "All Center",
28+
"Description": "All players Center message",
29+
"Command": "allcenter",
30+
"CenterElement": {
31+
"CenterMessage": "All Center",
32+
"CenterMessageTime": 7
33+
},
34+
"PrintTo": 3
35+
},
36+
{
37+
"Title": "Client Chat & Client Center",
38+
"Description": "Client Chat & Client Center message",
39+
"Command": "CCCC",
40+
"Message": "Client Chat",
41+
"CenterElement": {
42+
"CenterMessage": "Client Center",
43+
"CenterMessageTime": 10
44+
},
45+
"PrintTo": 4
46+
},
47+
{
48+
"Title": "Client Chat & All Center",
49+
"Description": "Client Chat & All Center",
50+
"Command": "CCAC",
51+
"Message": "Client Chat",
52+
"CenterElement": {
53+
"CenterMessage": "All Center",
54+
"CenterMessageTime": 3
55+
},
56+
"PrintTo": 5
57+
},
58+
{
59+
"Title": "All Chat & Client Center",
60+
"Description": "All Chat & Client Center",
61+
"Command": "ACCC",
62+
"Message": "All Chat",
63+
"CenterElement": {
64+
"CenterMessage": "Client Center",
65+
"CenterMessageTime": 4
66+
},
67+
"PrintTo": 6
68+
},
69+
{
70+
"Title": "All Chat & All Center",
71+
"Description": "All Chat & All Center",
72+
"Command": "ACAC",
73+
"Message": "All Chat",
74+
"CenterElement": {
75+
"CenterMessage": "All Center",
76+
"CenterMessageTime": 10
77+
},
78+
"PrintTo": 7
79+
}
80+
]

Examples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Examples
2+
3+
These are some examples what is possible with this plugin.

Examples/ServerCommands.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[
2+
{
3+
"Title": "Restart",
4+
"Description": "Command for restating the game",
5+
"Command": "rg,restart,restartgame",
6+
"Message": "Game is restarting",
7+
"PrintTo": 0,
8+
"ServerCommands": [
9+
"mp_restartgame 1"
10+
],
11+
// you should add permissions to server commands for security reasons. Do it on your own risk
12+
"Permission": {
13+
"RequiresPermissionOr": false, // true = Requires one of the permissions in the list | false = Requires all of the permissions in the list
14+
"PermissionList": [
15+
"#css/moderator" // needs to be in the simple-admin group
16+
]
17+
}
18+
},
19+
{
20+
"Title": "Enable Surf",
21+
"Command": "surf",
22+
"Message": "Surf is now enabled",
23+
"PrintTo": 0,
24+
"Description": "Command for enabling Surf gamemode",
25+
"ServerCommands": [
26+
"sv_cheats 1",
27+
"sv_falldamage_scale 0",
28+
"sv_party_mode 1",
29+
"mp_freezetime 2.5",
30+
"mp_round_restart_delay 2.5",
31+
"cl_ragdoll_gravity 0",
32+
"sv_accelerate 10",
33+
"sv_airaccelerate 1400",
34+
"sv_gravity 800.0"
35+
],
36+
"Permission": {
37+
"RequiresPermissionOr": true,
38+
"PermissionList": [
39+
"@css/cvar",
40+
"@customcommands/surf"
41+
]
42+
}
43+
}
44+
]

Examples/SimpleCommands.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"Command": "ping", // User types !ping or /ping in chat | The slash hides the input from a user in chat
66
"Message": "Pong!",
77
"PrintTo": 0
8-
}
8+
},
99
{
10-
"Title": "Rainbow",
11-
"Description": "rainbow command",
12-
"Command": "rainbow",
13-
"Message": "{RED}RAINBOW", // \n is a new line
10+
"Title": "Test",
11+
"Description": "Send test",
12+
"Command": "test",
13+
"Message": "test",
1414
"PrintTo": 0
1515
}
1616
]

Examples/Tags.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[
2+
{
3+
"Title": "Prefix",
4+
"Description": "Displays Prefix",
5+
"Command": "prefix",
6+
"Message": "This is the prefix from the plugin: {PREFIX}",
7+
"PrintTo": 0
8+
},
9+
{
10+
"Title": "Map Name",
11+
"Description": "Displays Map Name",
12+
"Command": "mapname",
13+
"Message": "Current mapname: {MAPNAME}",
14+
"PrintTo": 0
15+
},
16+
{
17+
"Title": "Time",
18+
"Description": "Displays the Time",
19+
"Command": "time",
20+
"Message": "Current time: {TIME}",
21+
"PrintTo": 0
22+
},
23+
{
24+
"Title": "Date",
25+
"Description": "Displays the Date",
26+
"Command": "date",
27+
"Message": "Current date: {DATE}",
28+
"PrintTo": 0
29+
},
30+
{
31+
"Title": "PlayerName",
32+
"Description": "Displays the player name of the player who executed the command",
33+
"Command": "playername",
34+
"Message": "Current user: {PLAYERNAME}",
35+
"PrintTo": 0
36+
},
37+
{
38+
"Title": "STEAMIDs",
39+
"Description": "Displays STEAMIDs of the current player",
40+
"Command": "steamids",
41+
"Message": "STEAMID2: {STEAMID2} STEAMID3: {STEAMID3} STEAMID32: {STEAMID32} STEAMID64: {STEAMID64}",
42+
"PrintTo": 0
43+
},
44+
{
45+
"Title": "Servername",
46+
"Description": "Displays Servername",
47+
"Command": "servername",
48+
"Message": "Current servername: {SERVERNAME}",
49+
"PrintTo": 0
50+
},
51+
{
52+
"Title": "IP",
53+
"Description": "Displays IP",
54+
"Command": "ip",
55+
"Message": "Current serverip: {IP}",
56+
"PrintTo": 0
57+
},
58+
{
59+
"Title": "Port",
60+
"Description": "Displays Port",
61+
"Command": "port",
62+
"Message": "Current port: {PORT}",
63+
"PrintTo": 0
64+
},
65+
{
66+
"Title": "MAXPLAYERS",
67+
"Description": "Displays Maxplayers of the server",
68+
"Command": "maxplayers",
69+
"Message": "Maxplayers: {MAXPLAYERS}",
70+
"PrintTo": 0
71+
},
72+
{
73+
"Title": "Player Count",
74+
"Description": "Displays Player Count of the server",
75+
"Command": "playercount",
76+
"Message": "Current playercount: {PLAYERS}",
77+
"PrintTo": 0
78+
}
79+
]

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
The Custom Commands Plugin allows you to create and customize commands for your server. These commands can display messages, perform server-side actions, and more. The configuration for these commands is stored in the `Commands.json` file located in the `./plugins/CustomCommands/` directory.
66

7+
For more examples look here: [Examples](https://github.com/HerrMagiic/CSS-CreateCustomCommands/tree/main/Examples)
8+
79
## Example Configuration
810

911
```json
@@ -105,6 +107,3 @@ Defines if the command requires specific permissions to execute:
105107
{DEFAULT}, {RED}, {LIGHTPURPLE}, {GREEN}, {LIME},
106108
{LIGHTGREEN}, {LIGHTRED}, {GRAY}, {LIGHTOLIVE},
107109
{OLIVE}, {LIGHTBLUE}, {BLUE}, {PURPLE}, {GRAYBLUE}
108-
109-
110-

0 commit comments

Comments
 (0)