Skip to content

Exports & events

Public API of Cuxial Admin: the event other resources can listen to and the events it reads.

Cuxial Admin has no exports. Its public surface is one client event, the editable hooks and a few events from other resources that it listens to.

Client events ​

cuxial_admin:revived ​

Fired on the client of a player who has just been revived by the panel's own revive. It carries no arguments.

lua
AddEventHandler('cuxial_admin:revived', function()
    -- reset your own death state here
end)

This event is not fired when cuxial_medical is running. In that case the revive goes through the medical system and the panel does nothing on its own.

Events it listens to ​

Cuxial Admin reacts to these events when another resource sends them. You do not need to do anything for them to work.

EventSideEffect
txAdmin:events:playerBannedServerAdds the ban to the sanctions history
txAdmin:events:playerKickedServerAdds the kick to the sanctions history
txAdmin:events:playerWarnedServerAdds the warning to the sanctions history

Hooks ​

hooks/server.lua and hooks/client.lua are the integration points. They stay editable after purchase: change them to connect a medical, key, fuel, appearance or weather system other than the default ones. Each function tells the panel whether your system handled the action.

Server · hooks/server.lua ​

HookReturnsWhat it does
Revive(target, by)booleanRevives a player. true if your system did it; false makes the panel use its own revive. Uses cuxial_medical when it is running.
Heal(target)booleanHeals a player.
Kill(target)booleanKills a player through your medical system.
HasAppearance()booleantrue if an appearance editor is running.
AddCommunityService(citizenid, amount, reason, staff)boolean, string?Gives community service. Uses cuxial_cmservices.
RemoveCommunityService(citizenid, staff)boolean, string?Removes community service.
weather.provider()string?Name of your weather system, or nil for the panel to apply time and weather by itself. av_weather and prim_climatime are detected.
weather.zoned(kind)booleantrue if that weather system works by zones.
weather.setTime, setFreeze, setBlackout, setWeather, read-Apply or read time, freeze, blackout and weather on the system named by kind.

Client · hooks/client.lua ​

HookReturnsWhat it does
HasKeys()booleantrue if your key system is running. Default: cuxial_garages.
GiveKeys(plate, vehicle)-Gives keys when a vehicle is spawned, its plate changes, or the panel gives keys.
SetFuel(vehicle, level)-Sets the fuel level for the panel's refuel button.
HasAppearance()booleantrue if an appearance editor is running.
OpenAppearance(variant)-Opens the editor. variant is appearance, clothing, barber, surgeon or outfits.
RestoreWalk(ped)-Gives back the walk style when an effect ends.

Internal events ​

Every other event and callback starting with cuxial_admin: is internal. They check the caller's rank on the server and may change without notice. Do not trigger them from your own resources.

© Cuxial