This page documents all available client-side functions in Glitch Abstraction. Functions are grouped by system and include required dependencies where applicable.
Functions on the GlitchAbst table on the client. A name that depends on a provider is marked. The ox_lib UI adapter is the most complete, and the qb and esx adapters cover a subset.
Framework#
| Function | What |
|---|---|
Framework.GetPlayerData() |
Player data (job, money and so on). Empty table before a character loads. |
Framework.TriggerCallback(name, cb, ...) |
Call a server callback. |
Framework.Notify(message, type, duration) |
Framework notification. |
Framework.ShowHelpNotification(message, thisFrame) |
Help text. |
Framework.SpawnPlayer(coords, callback) |
Spawn at coordinates. |
Framework.DrawText(x, y, text) |
2D text. |
Framework.GetClosestPlayer() |
Closest player and distance. |
Framework.GetVehicleProperties(vehicle) and SetVehicleProperties(vehicle, props) |
Vehicle properties. |
Notifications#
Notifications.Show(params) takes title, description (or message), type, duration and, with ox_lib, position, icon, iconColor, sound and more. The shortcuts Success, Error, Info and Warning each take (title, message, duration).
With glitch-notifications installed, AddBox, RemoveBox, Remove, Update and Toggle manage stacked notifications. With the other providers these return false or use a simple fallback. The ox_lib adapter also has Notifications.Ox.Custom, WithSound and WithAnimation.
UI (ox_lib adapter)#
| Group | Functions |
|---|---|
| Input | Input, InputForm, BuildForm, CloseInputDialog, and the Inputs field helpers |
| Context menus | RegisterContext, ShowContext, HideContext, GetOpenContext, OpenContextMenu, ContextMenu, CreateContextMenu, BuildMenuStructure, ConfirmContextMenu |
| Menus | RegisterMenu, ShowMenu, HideMenu, GetOpenMenu, SetMenuOptions, CreateMenuOption, OpenMenu, ConfirmMenu |
| Progress | ProgressBar, ProgressCircle, IsProgressActive, CancelProgress, CreateAnimation, CreateScenario, CreateProp, DrinkProgress, EatProgress |
| Text UI | ShowTextUI, HideTextUI, IsTextUIOpen, StyledTextUI, AnimatedTextUI, ShowInteractionTextUI, ShowSuccessTextUI, ShowErrorTextUI, ShowWarningTextUI |
| Alert | Alert |
| Radial | AddRadialItem, RemoveRadialItem, ClearRadialItems, RegisterRadial, HideRadial, DisableRadial, GetCurrentRadialId, CreateRadialItem, CreateRadialMenu, QuickRadial, RadialSubmenu |
| Checks | SkillCheck, IsSkillCheckActive, CancelSkillCheck, CustomDifficulty, SkillCheckSequence, Lockpick, Hack |
Target#
AddTargetEntity, RemoveTargetEntity (also RemoveLocalEntity), AddNetworkedEntity, RemoveNetworkedEntity, AddTargetModel, RemoveTargetModel, AddBoxZone, AddSphereZone, AddPolyZone, RemoveZone, AddGlobalPlayer, AddGlobalVehicle, AddGlobalObject, AddGlobalPed, the matching RemoveGlobal... calls, AddGlobalOption, RemoveGlobalOption and DisableTargeting. Aliases: AddBoxTarget, AddSphereTarget, AddCircleZone, AddPolyTarget and RemoveTarget.
Inventory (ox_inventory adapter)#
OpenInventory, OpenNearbyInventory, CloseInventory, GetItems, UseItem, UseSlot, SetStashTarget, GetCurrentWeapon, DisplayMetadata, GiveItemToTarget, WeaponWheel, Search, GetItemCount, HasItem, GetPlayerItems, GetPlayerWeight, GetPlayerMaxWeight, the slot helpers (GetSlotIdWithItem, GetSlotIdsWithItem, GetSlotWithItem, GetSlotsWithItem), and the state helpers IsInventoryBusy, SetInventoryBusy, AreHotkeysEnabled, SetHotkeysEnabled, IsInventoryOpen, CanUseWeapons and SetCanUseWeapons.
Door locks (ox_doorlock adapter)#
GetClosestDoor, GetDoorIdFromEntity, GetAllDoors, GetDoorState, LockDoor, UnlockDoor and SetDoorLocked.
Progression#
IsAvailable(), GetXPData(), GetXP(name) and GetLevel(name). With glitch-xpSystem there are also GetLevelXP(name, level) and GetCategoryLevel(name).
Scaleform#
Load, Unload, CallFunction, Render, SetupInstructionalButtons, ShowMessageBox, ShowMidsizeBanner, ShowMissionPassed, ShowCountdown, ShowHeistFinale and ShowCredits.
Cutscene#
Cutscene.Play(name, options), IsActive(), IsPlaying(), Stop(immediate), GetTime(), GetDuration(), SkipToTime(time), SavePlayerAppearance() and RestorePlayerAppearance(). Options include saveAppearance, restoreAppearance, hidePlayer, castPlayer, leadSlot, hideSlots, flags, customEntities, onStart, onEnd and timeoutMs. Names starting with mp_, and catalog entries with an MP_1 lead, are treated as online scenes and use flags 8.