Skip to content

Commit 75b7a1b

Browse files
committed
fix stuff
1 parent b1c3ff8 commit 75b7a1b

11 files changed

Lines changed: 65 additions & 52 deletions

File tree

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ We aim to:
2626
### Server Configuration
2727

2828
1. **Enable ACL enforcement** — Use FXServer's ACL system for robust admin control in standalone mode.
29-
2. **Validate framework settings** — Ensure `framework` in `settings.lua` matches your actual server setup.
29+
2. **Validate framework settings** — Ensure `Config.Framework` in `system/config.lua` matches your server setup.
3030
3. **Restrict database access** — Use role-based database credentials (ESX/QBCore).
3131
4. **Keep FXServer updated** — Minimum version 1226 or newer recommended.
3232

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
- Modern `fxmanifest.lua` (cerulean format)
1919
- Support for ESX, QBCore, QBox, and standalone frameworks
2020
- Modular architecture with clean separation of concerns
21-
- pxCommands event namespace throughout
21+
- pxc event namespace throughout
2222
- Enhanced SECURITY.md policy
2323
- Contributing guidelines
24+
- Complete user guides: GETTING_STARTED.md, COMMAND_PACKS.md, CONFIG_REFERENCE.md, TROUBLESHOOTING.md
25+
- docs/README.md navigation hub for documentation
2426

2527
### Changed
2628
- Rebranded from `chat_commands` to `pxCommands`
@@ -30,20 +32,30 @@
3032
- Autoupdate redirects to GitHub releases instead of file updates
3133
- Documentation reorganized: `.github/` for repo docs, `docs/` for guides
3234
- Replaced global `SETTINGS` with structured `Config` table
33-
- settings.lua now acts as override/customization file instead of config source
3435
- Improved framework detection with explicit export checking
3536
- Enhanced logging with config-aware defaults
3637
- README.md moved to .github/ (GitHub auto-discovers)
38+
- Event namespace shortened to `pxc:*` (pxc:proximity, pxc:showFloatingText)
39+
- Fixed script execution order in fxmanifest.lua
40+
- Removed settings.lua override file; configuration now directly in system/config.lua
41+
- Removed FXServer version check system (no longer required)
3742

3843
### Fixed
3944
- Fixed variable scope issue in ESX command registration (raw variable)
4045
- QBCore initialization now properly checks for export existence before use
4146
- Removed busy-wait loops in version check
4247
- Dead links and outdated documentation removed
4348
- Updated all doc cross-references to point to correct paths
49+
- Fixed Lua type diagnostics: SetTextProportional and SetTextCentre now use boolean instead of integer
50+
- Fixed GetDistanceBetweenCoords last parameter type (boolean instead of integer)
51+
- Added MySQL type annotation to prevent undefined global diagnostics
52+
- Fixed command registration execution order (pre.lua → commands/*.lua → commands.lua)
4453

4554
### Removed
4655
- Static version file from version checks (now uses GitHub releases)
4756
- vRP compatibility (deprecated; use ESX, QBCore, or QBox)
4857
- Old toxicdev.me documentation references
4958
- Corrupted dual-content in README
59+
- FXServer version check enforcement (fxcheck_1226.lua)
60+
- settings.lua configuration file (use system/config.lua directly)
61+
- Dynamic module auto-loading (sv_*.lua, sh_*.lua patterns)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A modular chat and command system for FiveM supporting ESX, QBCore, QBox, and st
1818

1919
1. Place `pxCommands` in your resources folder
2020
2. Add `ensure pxCommands` to `server.cfg`
21-
3. Edit `settings.lua` with your framework:
21+
3. Edit `system/config.lua` with your framework:
2222
```lua
2323
Config.Framework = 'esx' -- or 'qbcore', 'qbox', 'standalone'
2424
```

commands/example.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CommandPack("Example", "pxCommands", {
1+
CommandPack("Example", "CodeMeAPixel", {
22
{
33
command = "test",
44
format = "#name# used /test",

docs/ARCHITECTURE.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ system/
77
├── config.lua Shared configuration table
88
├── server/
99
│ ├── pre.lua Initialization, framework setup, helpers
10-
│ ├── commands.lua Command registration and handler
11-
│ └── fxcheck_*.lua Version checks (executed last)
10+
│ └── commands.lua Command registration and handler
1211
├── client/
1312
│ └── proximity.lua Range-based message broadcast
1413
└── versioncheck.lua Update checking and autoupdate
1514
modules/
16-
├── cl_*.lua Client modules (auto-loaded)
17-
├── sv_*.lua Server modules (auto-loaded)
18-
└── sh_*.lua Shared modules (auto-loaded)
15+
└── cl_*.lua Client modules (auto-loaded)
1916
commands/
2017
└── *.lua Command packs (auto-loaded)
2118
```
@@ -24,13 +21,8 @@ commands/
2421

2522
1. `fxmanifest.lua` loads all scripts in order
2623
2. `system/config.lua` initializes Config table
27-
3. `settings.lua` allowed to override Config
28-
4. `system/server/pre.lua` runs framework detection and init
29-
5. Any module files load based on pattern
30-
6. Command pack files load from `commands/`
31-
7. `system/server/fxcheck_*.lua` validates environment
32-
8. `system/server/commands.lua` registers all commands
33-
9. `system/versioncheck.lua` checks for updates
24+
25+
**Client:** `modules/cl_*.lua` client modules load in parallel with server
3426

3527
## Data Flow
3628

@@ -60,11 +52,7 @@ onCommandExecuted hook (if set)
6052

6153
## Configuration
6254

63-
Config is a global shared table. Modify in:
64-
- `system/config.lua` (defaults)
65-
- `settings.lua` (user overrides)
66-
67-
All fields optional; library provides sensible defaults.
55+
Config is a global shared table. Modify in `system/config.lua`.
6856

6957
## Security Model
7058

@@ -92,12 +80,38 @@ All fields optional; library provides sensible defaults.
9280

9381
## Extending pxCommands
9482

83+
### Custom Command Packs
84+
85+
The primary extension method is creating command packs in `commands/*.lua`:
86+
87+
```lua
88+
CommandPack("MyCustom", "AuthorName", {
89+
{
90+
command = "mycommand",
91+
help = "My custom command",
92+
format = "#username# did something",
93+
cb = function(source, message, command, args, raw)
94+
-- Your custom logic here
95+
end
96+
}
97+
})
98+
```
99+
100+
See [COMMAND_PACKS.md](./COMMAND_PACKS.md) for detailed documentation.
101+
95102
### Custom Modules
96103

97-
Drop `.lua` files into `modules/` and they auto-load via pattern:
98-
- `cl_*.lua` → Client (shared)
99-
- `sv_*.lua` → Server (shared)
100-
- `sh_*.lua` → Shared
104+
To add custom server or shared modules, manually add them to `fxmanifest.lua`:
105+
106+
```lua
107+
server_scripts {
108+
'system/server/pre.lua',
109+
'commands/*.lua',
110+
'modules/my_custom_module.lua', -- Add here
111+
'system/server/commands.lua',
112+
'system/versioncheck.lua'
113+
}
114+
```
101115

102116
### Custom Admin Logic
103117

docs/COMMAND_PACKS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ end
7575

7676
### Global Execution Hook
7777

78-
Set in `settings.lua`:
78+
Set in `system/config.lua`:
7979

8080
```lua
8181
Config.Callbacks.onCommandExecuted = function(source, message, command, args, raw)

docs/CONFIG_REFERENCE.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configuration Reference
22

3-
All config options live in `system/config.lua`. Override any value in `settings.lua`.
3+
All config options are defined in `system/config.lua`. Edit this file directly to customize behavior.
44

55
## Framework Selection
66

@@ -89,19 +89,11 @@ Parameters:
8989
- `args`: Argument table (split by spaces)
9090
- `raw`: Raw input string from RegisterCommand
9191

92-
## Server Version Check
9392

94-
```lua
95-
Config.FXServerCheck
96-
```
97-
98-
Read-only. Set by `system/server/fxcheck_1226.lua` to validate minimum FXServer version (1226+).
99-
100-
Do not modify.
10193

10294
## Example Override
10395

104-
In `settings.lua`:
96+
Edit `system/config.lua`:
10597

10698
```lua
10799
Config.Framework = 'qbcore'

docs/GETTING_STARTED.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## Configuration
1313

14-
Basic setup in `settings.lua`:
14+
Basic setup in `system/config.lua`:
1515

1616
```lua
1717
Config.Framework = 'esx' -- 'esx', 'qbcore', 'qbox', or 'standalone'

docs/TROUBLESHOOTING.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
**Problem**: Admin commands work for everyone
1616

17-
**Solution**: Configure `Config.AdminCheck` in `settings.lua`:
17+
**Solution**: Configure `Config.AdminCheck` in `system/config.lua`:
1818

1919
```lua
2020
Config.AdminCheck = function(source)
@@ -92,7 +92,7 @@ end
9292

9393
**Problem**: `Config.Framework` shows as detected but features fail
9494

95-
**Solution**: Check `settings.lua` override:
95+
**Solution**: Check `system/config.lua` settings:
9696

9797
```lua
9898
Config.Framework = 'esx' -- Explicitly set the framework
@@ -114,7 +114,5 @@ Do not rely on auto-detection if overriding in settings.
114114
## Uninstalling or Updating
115115

116116
1. Stop resource: `stop pxCommands`
117-
2. Backup `settings.lua` if customized
118-
3. Replace resource folder with new version
119-
4. Restore `settings.lua`
120-
5. Start: `start pxCommands`
117+
2. Replace resource folder with new version
118+
3. Start: `start pxCommands`

fxmanifest.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ repository 'https://github.com/CodeMeAPixel/pxCommands'
1010
version '0.1.0'
1111

1212
shared_scripts {
13-
'settings.lua',
1413
'system/config.lua'
1514
}
1615

@@ -20,8 +19,10 @@ client_scripts {
2019
}
2120

2221
server_scripts {
23-
'system/versioncheck.lua',
24-
'system/server/**'
22+
'system/server/pre.lua',
23+
'commands/*.lua',
24+
'system/server/commands.lua',
25+
'system/versioncheck.lua'
2526
}
2627

2728

0 commit comments

Comments
 (0)