-
-
Notifications
You must be signed in to change notification settings - Fork 38
Resources and http cef
NeekoGta edited this page Jun 18, 2026
·
2 revisions
The plugin serves packaged resources through a custom internal HTTP endpoint:
http://cef/<resource_name>/<path>Server-side resource directory:
scriptfiles/cef/<resource_name>/Example:
scriptfiles/
cef/
demo/
index.html
overlay.html
world2d.html
world3d.html
empty.html
css/app.css
js/app.jsRegister it:
CEF_AddResource("demo");Load it:
CEF_CreateBrowser(playerid, 1000, "http://cef/demo/index.html", false);Correct:
http://cef/demo/index.html
http://cef/demo/css/app.css
http://cef/demo/js/app.jsIncorrect:
cef://demo/index.html
/demo/index.html
file:///...For frontend build tools, asset paths must be relative.
Vite example:
import { defineConfig } from "vite";
export default defineConfig({
base: "./",
});Why:
-
assets/app.jsworks insidehttp://cef/demo/index.html; -
/assets/app.jspoints to the root and usually fails.
scriptfiles/cef/demo/
index.html
assets/
index-abc123.js
index-def456.cssWhen a player is missing packaged resources, the server can choose how the download progress is displayed.
cef_resources_loader_mode cef
# cef_resources_loader_mode samp_dialog
# cef_resources_loader_mode none
# cef_resources_loader_dialog_id 32700Legacy values are still accepted:
cef_resources_loader_ui 1 # same as cef
cef_resources_loader_ui 0 # same as none{
"cef": {
"resources_loader_mode": "cef",
"resources_loader_dialog_id": 32700
}
}Available modes:
| Mode | Behavior |
|---|---|
cef |
Uses the internal CEF loading UI. |
samp_dialog |
Uses a server-side SA-MP/open.mp TABLIST_HEADERS dialog. |
none |
Downloads silently. Use the download callbacks for custom TextDraws or server-side UI. |
cef_resources_loader_dialog_id / resources_loader_dialog_id is only used by samp_dialog.
The samp_dialog mode temporarily hides the SA-MP spawn screen during the resource download and restores the gamemode-requested spawn screen state when the download finishes.
If a resource does not update:
- Restart the server
- Delete the resource
.pakif needed - Ensure
CEF_AddResourcepoints to the right resource name - Check server logs for resource validation messages
CEF Plugin — Client & Server for SA-MP / open.mp
Issues & PRs welcome.