AI Core

ai-admin for developers

What ai-admin uses and exposes. It has no exports, and every tool runs through AI Core's layers.

ai-admin has no exports. Everything it does goes through AI Core, so the same calls are open to your own script:

ai-admin toolWhat it calls (lib, server)
Heal, revive, is downmedical (works with whichever death script runs)
Revive fills needsneeds.refill
Admin car keys, /givekeyvehicleKeys.give(source, vehicle, "temporary")
/carspawnVehicle after vehicleType(model, admin) checks the model
Item commands, open inventoryinventory (works with whichever inventory runs)
/items, menu "Give item"itemPicker
Weather, time, blackout, freezeworld (any weather script with the qb-weathersync contract)
/closeserverai-core's AddConnectionCheck
LogsaiLog("actions", ...)

Permission

Every admin command is registered with addCommand(..., { restricted: true }), which means ACE ai.admin. The quick menu's action callback checks isAdmin() on the server. A player can always switch noclip off; switching it on is asked from the server.

import { addCommand, notify } from "@aicore-fivem/lib/server";

// Your own admin-only command, with the same permission as ai-admin's.
addCommand("cleanarea", { help: "Clean the area", restricted: true }, (source) => {
  notify(source, "Area cleaned", "success");
});

Optional export it calls

The quick menu's Always show the map calls ai-hud's client export SetMinimapAlways(on) when ai-hud runs.

Events

All of ai-admin's events are internal (its client and its server); do not call them from other scripts.

NameKindWhat it does
ai-admin:accessclient callbackWhether the player may open the quick menu.
ai-admin:noclipclient callbackAsk to switch noclip on.
ai-admin:playersclient callbackThe online player list for the menu.
ai-admin:actionclient callbackOne quick menu action (admin checked on the server).
ai-admin:giveItemsclient callbackThe items picked in the item picker (at most 50 rows).
ai-admin:worldStateclient callbackThe weather and time for the Weather and time menu.
ai-admin:client:toggleNoclipserver to clientSwitch noclip.
ai-admin:client:teleportserver to clientTeleport to a point the server picked.
ai-admin:client:openMenu / openItemsserver to clientOpen the quick menu or the item picker.
ai-admin:client:coordsserver to clientShow the player's position.
ai-admin:client:warnedserver to clientShow an admin warning.

On this page