Ham Lua API Documentation
Note: The Ham API is accessible via
Ham,hamglobal tables. All functions are available in both camelCase and lowercase variants.
Categories
General
- getName - Get authenticated username
- getDiscordName - Get Discord username
- getDiscordId - Get Discord ID
- isGuiOpen - Check if GUI menu is open
Input Handling
- isKeyDown - Check if key is held
- isKeyPressed - Check if key was pressed
- isKeyReleased - Check if key was released
- isMouseDown - Check if mouse button is held
- isMouseClicked - Check if mouse was clicked
- isMouseDoubleClicked - Check for double-click
- isMouseReleased - Check if mouse was released
- getMousePos - Get mouse position
- getKeyState - Get async key state
- toggleMouse - Toggle mouse cursor
- toggleInputBlock - Block game input
Clipboard
- copyToClipboard - Copy text to clipboard
- getClipboard - Get clipboard contents
Drawing API
- drawLine - Draw a line
- drawRect - Draw rectangle outline
- drawRectFilled - Draw filled rectangle
- drawRectGradient - Draw gradient rectangle
- drawCircle - Draw a circle
- drawText - Draw text
- drawTexture - Draw a texture
- pushClipRect - Push clipping rectangle
- popClipRect - Pop clipping rectangle
- getTextWidth - Measure text dimensions
- getResolution - Get screen resolution
- worldToScreen - Convert 3D to 2D coordinates
Font Management
- addFont - Add built-in font
- addWindowsFont - Add Windows font
- addCustomFont - Add custom font from URL
- setFont - Set active font
- resetFont - Reset to default font
Texture Management
- addCustomTexture - Load texture from URL
- addCustomTextureAsync - Async texture load
- getAsyncTextureResult - Check async texture status
- cleanupAsyncTextureRequests - Cleanup texture requests
Utility Functions
- openUrl - Open URL in browser
- Execute - Execute Lua code
- disableWeather - Disable weather effects
- passObjectControl - Pass entity control
- lockEventLogger - Lock event logger
- unlockEventLogger - Unlock event logger
HTTP Client
- httpGet - Sync HTTP GET
- httpPost - Sync HTTP POST
- httpGetAsync - Async HTTP GET
- httpPostAsync - Async HTTP POST
- getAsyncResult - Check async HTTP status
- cleanupAsyncRequests - Cleanup HTTP requests
Server & Resource Info
- getServerEndpoint - Get server endpoint
- getServerHostname - Get server hostname
- getResources - Get all resources
- hasResource - Check if resource exists
- getInjectableResources - Get injectable resources
- getSafeResources - Get safe resources
- getAntiCheats - Get detected anti-cheats
- getAllStateBags - Get all state bags
- getAllEvents - Get all events
- getAllRegisteredEvents - Get registered events
- findEvent - Search for event
- getPedModelNames - Get ped model names
Player Features
- godMode - Toggle invincibility
- noClip - Toggle no-clip
- setNoClipSpeed - Set no-clip speed
- aimBot - Toggle aimbot
- setAimbotFov - Set aimbot FOV
- setAimbotSmoothing - Set aimbot smoothing
- setAimbotBone - Set target bone
- setAimbotKey - Set aimbot key
- setAimbotIgnoreVehicles - Ignore vehicles
- setAimbotVisibleOnly - Target visible only
- freeCam - Toggle free camera
- setFreecamSpeed - Set freecam speed
- camBypass - Toggle camera bypass
- spoofTeleport - Toggle teleport spoof
- spoofAllVisible - Spoof visibility
- spinBot - Toggle spin bot
- setSpinbotSpeed - Set spinbot speed
- setPosition - Set player position
- setKeyboardLayout - Set keyboard layout
- antiTeleport - Toggle anti-teleport
- invisible - Toggle invisibility
- speedSpoof - Toggle speed spoof
- antiBlockControl - Toggle anti-block
- pedSpoof - Toggle ped spoof
- spectatorMode - Toggle spectator mode
Reference
- Data Types - Position, color, rectangle formats
- Key Codes - ImGui and virtual key codes