SA:O Lua API
302 APIs added or extended by San Andreas Online
Every public Lua function added or extended by San Andreas Online is listed below. Browse the six areas, filter by where an API runs, or enter part of a function name.
Advanced filters
302 of 302 APIs shown
82 APIs
NPCs and gameplay AI
Walking styles, ambient populations, traffic, and actions driven by GTA’s original AI.
2 APIs
NPC walking styles
Make an NPC use the natural movement style of its current character model.30 APIs
Ambient NPCs and road traffic
Ask GTA for suitable NPCs, vehicles, spawn points, groups, and ambient behavior.updateAmbientPedPopulationModelsRuns GTA's ped-only zone-model residency pass around an origin without enabling unmanaged population creation.
clientresetAmbientPedPopulationModelsReleases the stock population-model residency established by the ambient-ped update pass.
clientaddPedNativeGunAimedAtEventInserts GTA's real aimed-at event on the authoritative ambient-ped owner.
clientaddPedNativeDamageResponseEventReplays GTA's civilian damage decision on the authoritative owner without applying physical damage again.
clientgetAmbientVehicleSpawnCandidateAsk GTA to choose a valid road lane, position, direction, speed, and driving style for a vehicle near the player—without creating the vehicle.
clientgetAmbientVehicleModelCandidateAsk GTA which civilian road vehicle naturally fits the current area and population settings—without creating it.
clientgetAmbientVehicleOccupantModelCandidateAsk GTA which pedestrian skins naturally fit a vehicle, so it can be created with a suitable driver and passengers.
clientgetAmbientPedSpawnCandidateAsk GTA where it would naturally place an NPC near a position. The result includes the suggested skin, NPC type, position, and facing direction—without creating the NPC.
clientgetAmbientPedPopulationProfileReturns GTA's current ambient population targets, zone state, density multipliers, and gang weights.
clientresetAmbientPedPopulationZonesToBootstrapRestores the stock main.scm population-zone bootstrap inside San Andreas Online's reversible population world state.
clientsetAmbientPedPopulationZoneStateOverrides selected native population fields for one GTA navigation zone inside the reversible population world state.
clientisAmbientPedSphereVisibleRuns GTA's camera-frustum sphere test without creating an entity.
clientgetAmbientPedGangGroupCandidateAsks GTA for a native ambient gang-group placement with two to four proposed members.
clientgetAmbientPedCivilianCoupleCandidateAsk GTA for two compatible civilian skins and nearby path positions that can spawn together as a walking couple.
clientacquirePedNativeGroupPut several NPCs into one group so GTA treats them as a single walking group and manages their shared movement.
clientreleasePedNativeGroupReleases a native ambient group token owned by the calling resource.
clientisPedNativeGroupActiveReports whether the calling resource still owns a live native ambient group.
clientgetPedNativeGroupDiagnosticReturns focused ownership and native-member diagnostics for one ambient group token.
clientaddPedNativeDamageEventReplay a server-approved native NPC hit on the victim client so GTA applies the health, armour, hit reaction, and fall response once.
clientaddPedNativeBikeJackTaskInstalls GTA's canonical bike-jacked task on the authoritative local player after a synchronized ambient gang carjack is validated.
clientisPedNativeAmbientCopWanderTaskReports whether San Andreas Online's safe ambient-cop wander task is the ped's current primary task.
clientvalidatePedNativeCouplePre-flight check that reports whether two peds can form a native GTA couple and which one should lead.
clientacquirePedNativeCouplePair two NPCs and GTA makes them walk together, choose their side, hold hands, and look at each other. They separate if they move too far apart.
clientreleasePedNativeCoupleReleases a native couple lease owned by the calling resource.
clientisPedNativeCoupleActiveReports whether the calling resource still owns a live native couple.
clientgetPedNativeCoupleDiagnosticReturns focused lease, task, and per-member diagnostics for one native couple token.
clientacquirePedNativeCouplePresentationOpens an observer-side presentation channel so a non-syncing client can present two peds as a walking couple.
clientupdatePedNativeCouplePresentationRefreshes the observer-side couple pairing and walk-side presentation for one token.
clientreleasePedNativeCouplePresentationCloses an observer-side couple presentation channel owned by the calling resource.
clientisPedNativeCouplePresentationActiveReports whether the calling resource still owns a live observer-side couple presentation.
client50 APIs
NPC actions and mission behavior
Give NPCs native movement, driving, combat, interaction, and action sequences, and control gang-tag progress.Movement & social
12 APIssetPedGoToSend an NPC straight toward a nearby coordinate. GTA handles the walk or run, slows the NPC down, and stops it inside the arrival radius.
clientsetPedNavigateToGive an NPC a destination and GTA's pedestrian pathfinder takes over: it chooses a route through the native path network, goes around buildings, walks or runs naturally, slows down, and stops near the target.
clientsetPedChatWithPair two NPCs and GTA makes them face each other and perform its original conversation behavior, with one character leading and the other replying.
clientsetPedStandStillQueues GTA's simple stand-still task on a simulated ped.
clientsetPedJumpStarts GTA's native jump, airborne, optional climb, and landing task chain on a ped simulated by this client.
clientsetPedTurnToFaceQueues GTA's native body-turn task so an owned ped faces another live ped.
clientsetPedGoToOffsetTell an NPC to move to a chosen side and distance around another NPC. GTA tracks the other NPC while approaching that offset.
clientsetPedWanderTell an NPC to wander and GTA's original pedestrian AI takes over: it follows the native path network, chooses its own direction from node to node, and keeps walking or running without Lua waypoints.
clientsetPedScriptedSpeechMutedEnables or suppresses a ped's GTA scripted speech without muting unrelated game audio.
clientsetPedFacialTalkRequests GTA's native FACTALK expression on a streamed ped's persistent facial controller.
clientstopPedFacialTalkStops all active requests on a streamed ped's native facial controller.
clientisPedNativeTaskReadyCheck whether a living, streamed ped has its GTA AI brain back and is ready for a native task call. This is useful just after stream-in or a cutscene rebuild, when the element exists before GTA has finished recreating its intelligence.
clientVehicles & driving
5 APIssetPedEnterVehicleEXTENSIONTell an NPC which vehicle and seat to enter. GTA makes it approach the vehicle, use the correct door, and get in as driver or passenger.
clientsetPedExitVehicleEXTENSIONTell an NPC to leave its vehicle and GTA performs the original exit movement, animation, and door handling.
clientsetPedDriveWanderPut an NPC behind the wheel and tell it to cruise. GTA's original driving AI takes over: it follows the native road network, chooses streets, steers, accelerates, brakes, and reacts to traffic according to the driving style.
clientsetPedDriveToGive an NPC driver a destination and GTA's original driving AI takes over: it follows the native road network, chooses a route, steers, accelerates, and brakes as it drives toward the target.
clientsetPedDriveMissionTell an NPC driver to escort another vehicle from its left side using GTA's original mission-driving AI.
clientCombat
7 APIssetPedKillOnFootGive an NPC a target and GTA's combat AI takes over: it follows them, chooses between guns and melee, aims, attacks, and reacts to nearby vehicles.
clientsetPedDriveByGive a passenger a target and GTA makes them turn, aim, animate, and fire from the vehicle using its built-in drive-by behavior.
clientsetPedShootAtGive an NPC a world position and GTA makes it aim and fire controlled bursts at that point for the requested duration.
clientgetPedWeaponShootingRateReads GTA's current shooting-rate byte from a streamed ped's native instance.
clientsetPedWeaponShootingRateSets GTA's persistent shooting-rate byte used by native gun tasks.
clientsetPedWeaponAccuracySets GTA's persistent 0–255 weapon-accuracy byte used for shot spread.
clientgetPedWeaponAccuracyReads GTA's persistent 0-255 weapon-accuracy byte used for shot spread.
clientNPC rules
19 APIssetPedMissionActorPersists GTA's PED_MISSION classification on a script-created ped across native model recreation.
clientisPedMissionActorReports the locally persisted mission-actor policy, including while the native model is streamed out.
clientacquirePedNativeEventProfileExclusively leases one of San Andreas Online's stock native-event adapters for a script ped.
clientreleasePedNativeEventProfileReleases one native ped event-profile token owned by the calling resource.
clientisPedNativeEventProfileActiveReports whether this resource's native event-profile lease is active for the current authoritative ped generation.
clientsetPedStoryProtectedPersists GTA's grouped story-actor protection flags on a script ped across native recreation.
clientisPedStoryProtectedReports the locally persisted grouped story-actor protection policy.
clientsetPedSuffersCriticalHitsPersists GTA's critical-hit policy on a script ped without enabling the broader story-protection tuple.
clientgetPedSuffersCriticalHitsReads the locally persisted critical-hit policy for a script ped, including while it is streamed out.
clientsetPedStayInSamePlacePersists GTA's scalar stay-in-place flag on a script ped without assigning a stand-still task.
clientgetPedStayInSamePlaceReads the effective local stay-in-place flag for a script ped.
clientsetPedNeverTargetedPersists only GTA's never-targeted bit without enabling the grouped protagonist protection policy.
clientisPedNeverTargetedReads the effective local never-targeted policy for a script ped.
clientsetPedPhysicalProofsChoose exactly which kinds of physical damage an NPC ignores: bullets, fire, explosions, collisions, or melee hits.
clientgetPedPhysicalProofsRead the NPC's five stored physical-damage protections so a resource can change them temporarily and restore them later.
clientsetPedCanBeDraggedOutChoose whether a script-created NPC can be pulled out of its vehicle during a carjack. Set false to keep an important driver or passenger in the car; set true to allow the normal GTA extraction.
clientcanPedBeDraggedOutCheck whether GTA currently allows a script-created NPC to be pulled out of its vehicle.
clientsetPedOnlyDamagedByPlayerMake a script-created NPC ignore GTA damage events whose attacker is not a player, while still allowing attacks attributed to a player. This matches the story-script rule used for actors who should be hurt by the player but not by other NPCs.
clientisPedOnlyDamagedByPlayerCheck whether a script-created NPC currently uses GTA's player-attributed-damage-only rule.
clientAction sequences
2 APIsGang tags
5 APIssetObjectGangTagAlphaSets a logical 0–255 Grove-material alpha on a streamed native gang-tag object, or clears the opt-in override.
clientacquireObjectGangTagTurn a supported object into a real sprayable GTA gang tag. GTA advances the paint progress naturally and the state survives streaming.
clientsetObjectGangTagProgressApplies an authoritative 0–255 progress byte to a gang tag owned by the calling resource.
clientgetObjectGangTagProgressReads the persistent progress byte of an acquired gang tag.
clientreleaseObjectGangTagUnregisters an owned tag from GTA's native spray path and clears its Grove-material override.
client57 APIs
Story and mission tools
Streaming, mission vehicles, scene loading, cameras, cutscenes, audio, text, and recorded routes.
2 APIs
Streaming control
Keep important elements streamed while a resource needs their native GTA state.8 APIs
Mission vehicle behavior
Control locks, tyres, physical protection, collision loading, and mission vehicle checks.setVehicleDoorLockModeSets and persists GTA's raw native door-lock mode without reducing it to a boolean.
clientgetVehicleDoorLockModeReads the vehicle's raw native door-lock mode, including a locally persisted streamed-out value.
clientsetVehicleTyresCanBurstSets and persists GTA's native tyre-burst policy independently from ordinary body damage.
clientgetVehicleTyresCanBurstReads the vehicle's live or locally persisted native tyre-burst policy.
clientsetVehiclePhysicalProofsSets and persists GTA's five independent physical-proof flags on a vehicle.
clientsetVehicleLoadCollisionFlagPersists GTA's mission-car collision-loading and physics-to-ghost policy independently from ordinary element collisions.
clientsetVehicleStraightLineDistanceTune GTA's built-in straight-line distance value for a vehicle's native autopilot, as used by original mission driving.
clientgetVehicleStraightLineDistanceRead the vehicle's current GTA autopilot straight-line distance value so it can be restored after a mission task.
client3 APIs
Scene loading and vehicle helpers
Prepare a world area and use small GTA mission vehicle primitives.enginePreloadWorldAreaInDirectionAsk GTA to preload the world around a destination and viewing direction before revealing a teleport or cutscene.
clientreportVehicleMissionAudioEventReports one verified GTA script-audio event on a streamed vehicle's native audio entity.
clientisVehicleOnAllWheelsReproduces GTA opcode 09D0's exact all-four-contact vehicle gate.
client14 APIs
Scripted cameras
Own and control GTA cameras, movement, tracking, fades, widescreen, and near clip.acquireScriptCameraAcquires the resource-exclusive GTA script camera and returns a generation token.
clientreleaseScriptCameraRestores captured gameplay camera state and optionally leaves a successful scene under its black fade.
clientisScriptCameraLeaseActiveReports whether the calling resource still owns the specified camera generation.
clientsetScriptCameraFixedPlace the camera at one position and make it look at another, using an immediate cut or GTA's camera transition.
clientmoveScriptCameraMove the camera between two world positions over a chosen duration, linearly or with GTA's original easing.
clienttrackScriptCameraAnimate what the camera looks at from one point to another, independently from the camera's own movement.
clientsetScriptCameraPersistSelects whether completed position and target tracks retain their endpoints.
clientresetScriptCameraResets GTA's scriptable camera interpolation components without releasing the lease.
clientfadeScriptCameraRuns GTA's native fade under the current camera lease.
clientisScriptCameraFadingReports the native fade state for the current camera generation.
clientisScriptCameraMoveRunningReports whether the native position track is still running.
clientisScriptCameraTrackRunningReports whether the native look-at track is still running.
clientsetScriptCameraWidescreenUses GTA's native widescreen transition under the current lease.
clientsetScriptCameraNearClipSets GTA's scripted near clip, or clears the override with false.
client11 APIs
Original GTA cutscenes
Load, play, fade, skip, and release GTA’s original file-based cutscenes.requestFileCutsceneLoad one of GTA:SA's original mission cutscenes by name. The returned handle lets Lua start it, detect completion, skip it, and restore gameplay afterward.
clientisFileCutsceneLeaseActiveReports whether the calling resource still owns this file-cutscene generation.
clientisFileCutsceneLoadedReports whether GTA has finished loading the owned DAT/CUT/IFP cutscene data.
clientstartFileCutsceneStarts an owned, fully loaded native file cutscene exactly once.
clientfadeFileCutsceneRuns GTA's native fade while the file-cutscene lease is active.
clientisFileCutsceneFadingReports the native fade state for the current file-cutscene generation.
clientisFileCutsceneFinishedReports native camera-spline completion after this lease successfully started playback.
clientisFileCutsceneSkipInputPressedReads GTA's original cutscene skip input without applying the skip locally.
clientwasFileCutsceneSkippedReports whether GTA's native skip path completed the owned playback.
clientskipFileCutsceneApplies GTA's native skip path to the owned playback.
clientreleaseFileCutsceneDeletes the owned native cutscene and restores the camera, near clip, widescreen, and controls captured by its lease.
client6 APIs
Mission sounds and completion music
Load and play GTA mission audio and the original mission-complete tunes.playMissionPassedTunePlays one of GTA's two native mission-passed beat tracks.
clientrequestMissionAudioPreloads a supported GTA script-audio event and returns a resource-owned opaque handle.
clientisMissionAudioLoadedReports whether an owned native mission-audio event has finished loading.
clientplayMissionAudioStarts one loaded mission-audio handle exactly once through GTA's native player.
clientisMissionAudioFinishedReports natural completion after playback has started.
clientreleaseMissionAudioClears an owned native event and releases its physical mission-audio slot.
client7 APIs
Mission text and HUD messages
Show GTA mission text, help prompts, and large on-screen messages.acquireMissionTextExclusively loads one GTA mission GXT block for the calling resource.
clientshowMissionTextQueues a translated key through GTA's native small-message PRINT_NOW path.
clientshowMissionHelpDisplays a translated key through GTA's native help-message HUD.
clientshowMissionBigTextQueues GTA's native big mission text, optionally substituting one number.
clientclearMissionTextsClears the calling resource's tracked small and big native messages.
clientclearMissionHelpClears the calling resource's native help message.
clientreleaseMissionTextClears owned messages/help and releases the exclusive mission-text lease.
client6 APIs
Recorded vehicle routes
Load and play GTA vehicle recordings for scripted driving scenes.requestVehicleRecordingAcquires and requests one registered GTA carrec recording for the calling resource.
clientisVehicleRecordingLoadedReports whether a registered recording currently has a streamed native frame buffer.
clientstartVehiclePlaybackStarts direct non-looped GTA recorded-car playback on a vehicle owned by the local unoccupied-vehicle syncer.
clientstopVehiclePlaybackStops playback when the calling resource owns the vehicle's active native slot.
clientsetVehiclePlaybackSpeedSpeed up, slow down, or pause a vehicle while it follows its active GTA recorded route.
clientisVehiclePlaybackActiveReports whether GTA's native 16-slot player currently contains the vehicle.
client32 APIs
World, maps and models
Custom models, protected assets, imported maps, radar tiles, environment zones, seabed, and runtime collision.
11 APIs
Custom models
Allocate stable custom model IDs and resolve the GTA slots used by each client.engineRequestModelReserve a custom model ID for an object, vehicle, or ped so the server and all clients can use it consistently.
serverengineFreeModelReleases a logical model owned by the calling resource after remapping surviving elements to their native parent.
serverengineGetModelParentReturns the native GTA parent of an active server-managed logical model.
serverengineGetModelNameReturns the active model's resource-qualified registry name.
serverengineGetModelTypeReturns whether a server-managed model is an object, vehicle, or ped.
serverengineGetModelIDFromNameResolves a server-managed model by resource-local or fully qualified name.
serverengineGetModelsEnumerates active server-managed logical model IDs, optionally filtered by type.
serverengineIsModelAllocatedReports whether a logical model definition is currently active.
serverengineGetModelAvailableCountReturns the number of additional model definitions the calling resource may allocate.
serverengineGetModelRuntimeIDResolves a stable server model ID to the GTA runtime slot allocated on this client.
clientengineGetModelServerIDReverse-resolves a client runtime slot to its stable server logical model ID.
client1 APIs
Encrypted resource assets
Authenticate and apply protected DFF, TXD, and COL files without exposing keys or plaintext to Lua.6 APIs
SA-MP maps and object materials
Parse SA-MP map source and control object materials and streaming limits.engineParseSAMPMapParses Texture Studio / SA-MP Pawn map source into inert objects, building removals, material overrides, and diagnostics.
clientengineGetTXDIDFromNameResolves a loaded GTA texture-dictionary name to its current TXD slot.
clientsetObjectMaterialApplies an SA-MP-style texture and/or color override to one DFF material slot on a client object.
clientremoveObjectMaterialRemoves one SA-MP-style material-slot override from a client object.
clientengineSetObjectStreamingLimitsRedistributes MTA's fixed 1000-slot object streaming budget between normal and low-LOD objects.
clientengineGetObjectStreamingLimitsReturns the current normal-object quota, low-LOD quota, and fixed combined maximum.
client3 APIs
Custom radar tiles
Replace individual radar and F11 map tiles with resource-provided textures.engineSetRadarMapTileRegisters or replaces a resource-owned TXD in one cell of San Andreas Online's sparse 40 × 40 native radar grid.
clientengineResetRadarMapTileRemoves a radar tile owned by the calling resource and restores the native ocean fallback.
clientengineGetRadarMapStatsReturns the current extended-radar hook, registration, loading, failure, and source-byte counters.
client3 APIs
Ocean and seabed boundaries
Move or restore the outer boundary of GTA’s procedural seabed.6 APIs
World environment zones (CULL)
Read, create, change, disable, and restore GTA environment zones.engineGetCullZonesLists adopted vanilla and custom CULL zones, optionally filtered by zone type.
clientengineCreateCullZoneCreates a resource-owned native CULL zone and returns its stable ID.
clientengineSetCullZoneReplaces an owned or claimed zone definition while retaining its stable ID.
clientengineSetCullZoneEnabledEnables or disables a custom zone or a vanilla zone claimed by the caller.
clientengineRemoveCullZoneDeletes an owned custom zone or temporarily removes a claimed vanilla zone.
clientengineRestoreCullZoneRestores a claimed vanilla zone to its original definition and releases the caller's edit state.
client2 APIs
Lua-generated collision
Build collision data at runtime and apply it to models.105 APIs
Objects, environment and effects
Physics, breakable objects, ropes, fire, birds, foliage, and model lights or effects.
2 APIs
Dynamic object physics
Let synchronized objects use GTA’s native physical movement.15 APIs
Breakable objects
Break object models into physical fragments and control their durability.createObjectBreakEffectFractures a streamed object into fragments cut from its own live geometry.
clientsetObjectBreakProfileGives an object durability so ordinary GTA damage fractures it on its own.
clientgetObjectBreakProfileReturns the durability profile armed on an object.
clientclearObjectBreakProfileDisarms an object, leaving it undamageable by the managed path again.
clientgetObjectBreakHealthReturns an armed object's remaining durability.
clientsetObjectBreakHealthSets an armed object's remaining durability.
clientresetObjectBreakHealthRestores an armed object to the health its profile was created with.
clientgetBreakEffectFragmentCountReturns how many fragments an object was cut into.
clientgetBreakEffectSourceTriangleCountReturns the triangle count of the mesh the fragments were cut from.
clientgetBreakEffectSleepingFragmentCountReturns how many fragments have settled and stopped simulating.
clientgetBreakEffectCacheHitReports whether this fracture reused cached geometry instead of cutting the mesh again.
clientisBreakEffectPausedReports whether a fracture's debris simulation is frozen.
clientsetBreakEffectPausedFreezes or resumes a fracture's debris mid-flight.
clientgetBreakEffectCacheSizeReturns how many models currently hold cached fracture geometry.
clientclearBreakEffectCacheDrops every cached fracture geometry entry.
client28 APIs
Ropes
Create and control GTA ropes, holders, carried objects, length, movement, and physics.createRopeCreates a managed rope driven by one of GTA's own native rope types.
client + servergetRopeTypeReturns which native GTA rope type a rope runs.
client + serversetRopeTypeChanges which native GTA rope type a rope runs.
client + servergetRopeDurationReturns the total lifetime a rope was created with, in milliseconds.
client + serversetRopeDurationSets a rope's total lifetime in milliseconds.
client + servergetRopeRemainingTimeReturns how long a rope still has before it expires.
client + serversetRopeRemainingTimeExtends or shortens a live rope without recreating it.
client + servergetRopeHolderReturns the element a rope hangs from.
client + serversetRopeHolderSets the element a rope hangs from.
client + servergetRopeHolderOffsetReturns the local offset of the rope's attachment on its holder.
client + serversetRopeHolderOffsetMoves the rope's attachment point on its holder.
client + servergetRopeLengthReturns a rope's length.
client + serversetRopeLengthChanges a rope's length, which is how attached cargo is raised or lowered.
client + servergetRopeWinchHeightReturns a rope's winch height.
client + serversetRopeWinchHeightSets a rope's winch height.
client + servergetRopeFixedNodeReturns which node of the rope is pinned.
client + serversetRopeFixedNodePins one node of the rope.
client + serverisRopeOnGroundReports whether a rope is set to sit on the ground.
client + serversetRopeOnGroundSets whether a rope sits on the ground.
client + servergetRopeTopVelocityReturns the velocity applied at the top of a rope.
client + serversetRopeTopVelocityApplies velocity at the top of a rope.
client + serverisRopePhysicsEnabledReports whether a rope is simulated by the native solver.
client + serversetRopePhysicsEnabledTurns the native rope solver on or off for one rope.
client + servergetRopeCarriedElementReturns the element a rope is currently carrying.
client + serverattachElementToRopeAttaches an element to a rope so the native solver carries it.
client + serverdetachElementFromRopeReleases whatever a rope is carrying.
client + servergetRopePositionAtReturns an interpolated point along a rope, read from the live native solver.
clientisRopeActiveReports whether a rope currently holds one of GTA's eight native rope slots.
client20 APIs
Fire
Create synchronized fires and control their lifetime, damage, spread, source, and target.createFireEXTENSIONCreates a managed fire element when given an options table, or the original native GTA fire otherwise.
client + serverextinguishFireEXTENSIONDestroys one managed fire element, in addition to the standard radius and no-argument forms.
client + servergetFireStrengthReturns the strength multiplier of a managed fire.
client + serversetFireStrengthChanges how large a managed fire burns, without recreating it.
client + servergetFireDurationReturns the total lifetime a managed fire was created with, in milliseconds.
client + serversetFireDurationSets the total lifetime of a managed fire in milliseconds.
client + servergetFireRemainingTimeReturns how long a managed fire still has to burn, in milliseconds.
client + serversetFireRemainingTimeExtends or shortens a burning managed fire without recreating it.
client + serverisFireDamageEnabledReports whether a managed fire damages anything at all.
client + serversetFireDamageEnabledTurns damage on or off for one managed fire, leaving the visual effect alone.
client + servergetFireDamageTargetsReturns which element categories a managed fire is allowed to damage.
client + serversetFireDamageTargetsRestricts a managed fire to damaging only selected element categories.
client + serverisFireSpreadEnabledReports whether a managed fire can spawn further fires.
client + serversetFireSpreadEnabledAllows or prevents a managed fire from spreading.
client + servergetFireMaxGenerationsReturns how many further generations a spreading managed fire may produce.
client + serversetFireMaxGenerationsBounds how far a spreading managed fire can propagate.
client + servergetFireSourceReturns the element blamed for a managed fire's damage.
client + serversetFireSourceSets which element is held responsible for a managed fire's damage.
client + servergetFireTargetReturns the element a managed fire is following.
client + serversetFireTargetAttaches a managed fire to an element so it follows wherever that element goes.
client + server20 APIs
Birds
Create birds and control their flight, appearance, visibility, and reactions to shots.createBirdCreates a managed bird element with its own renderer and flight control.
clientprocessBirdGunShotRuns a gunshot trace against every shootable managed bird, for custom weapon systems.
clientgetBirdVelocityReturns the current velocity of a managed bird.
clientsetBirdVelocitySets a managed bird's velocity immediately.
clientgetBirdTargetVelocityReturns the velocity a managed bird is easing toward.
clientsetBirdTargetVelocitySets where a managed bird should be heading and lets it ease toward it.
clientgetBirdSizeReturns the size multiplier of a managed bird.
clientsetBirdSizeChanges how large a managed bird is drawn.
clientgetBirdColorsReturns the body and wing colors of a managed bird.
clientsetBirdColorsRecolors a managed bird's body and wings.
clientgetBirdWingBeatTimeReturns the wing beat period of a managed bird.
clientsetBirdWingBeatTimeChanges how fast a managed bird flaps.
clientgetBirdRenderDistanceReturns the distance at which a managed bird stops being drawn.
clientsetBirdRenderDistanceSets how far away a managed bird remains visible.
clientisBirdCurvedFlightEnabledReports whether a managed bird banks through curves instead of flying straight.
clientsetBirdCurvedFlightEnabledTurns curved flight on or off for one managed bird.
clientisBirdShootableReports whether a managed bird takes part in gunshot hit testing.
clientsetBirdShootableMakes a managed bird shootable, or purely decorative.
clientisBirdMovementEnabledReports whether a managed bird is currently flying or frozen.
clientsetBirdMovementEnabledFreezes one managed bird in place or lets it fly again.
client7 APIs
Grass and foliage
Create custom foliage patches from Lua-controlled ground triangles.createFoliageGrows GTA's native plants inside a world-space triangle by registering it with the native plant manager.
clientgetFoliageVerticesReturns the three world-space corners of a foliage patch.
clientsetFoliageVerticesReplaces the three corners of a foliage patch and rebuilds the native triangle.
clientgetFoliageSurfaceReturns the GTA surface ID a foliage patch grows from.
clientsetFoliageSurfaceChanges which GTA surface type a foliage patch grows, rebuilding the native triangle.
clientgetFoliageDensityReturns the density multiplier of a foliage patch.
clientsetFoliageDensityChanges how thickly a foliage patch grows, rebuilding the native triangle.
client13 APIs
Model lights and effects (2DFX)
Add, remove, inspect, and change lights and other effects stored on a model.addModel2DFXAdds a resource-owned 2DFX effect to a GTA model.
clientremoveModel2DFXRemoves one 2DFX effect from a model, including an effect GTA shipped.
clientrestoreModel2DFXRestores an original GTA effect that this resource removed.
clientresetModel2DFXEffectsRolls a model back to its original 2DFX state, dropping this resource's additions and overrides.
clientgetModel2DFXCountCounts the 2DFX effects on a model.
clientgetModel2DFXTypeReturns the type of one effect on a model.
clientgetModel2DFXEffectsReturns every 2DFX effect on a model with its type, position and properties.
clientgetModel2DFXPositionReturns one effect's position, local to the model.
clientsetModel2DFXPositionMoves one effect within its model.
clientresetModel2DFXPositionRestores one effect's original position.
clientgetModel2DFXPropertyReads one property of one effect.
clientsetModel2DFXPropertyChanges one property of one effect, including on an effect GTA shipped.
clientresetModel2DFXPropertyRestores one property to its original value.
client18 APIs
Rendering, audio and client
Renderer diagnostics, markers, vehicle sound, GTA radio, visual settings, and web links.
6 APIs
Rendering limits and distant lights
Inspect expanded renderer capacity and control distant world lights.engineGetRendererStatsReturns current, session-high-water, and capacity counters for San Andreas Online's expanded renderer arrays.
clientengineResetRendererStatsResets renderer high-water measurements without changing capacities or active objects.
clientengineSetDistantLightsEnabledEnables or disables San Andreas Online's native Project2DFX distant static lights.
clientengineSetDistantLightsDrawDistanceSets the distant-light draw distance.
clientengineRebuildDistantLightsRefreshes the distant-light catalogue from San Andreas Online's startup capture and currently available world data.
clientengineGetDistantLightStatsReturns Project2DFX catalogue, visible render-queue, and capacity counters.
client2 APIs
Mission markers and marker limits
Inspect marker capacity and draw GTA’s pulsing mission-area marker.4 APIs
Custom vehicle sounds
Load custom engine banks and trigger configured backfire sounds and flames.engineLoadVehicleAudioConfigAcquires the client-wide vehicle-audio lease and loads Soundize-compatible model definitions from the calling resource.
clientengineReloadVehicleAudioConfigReparses the current owner's definitions and schedules a clean lazy restart of the vehicle-audio banks.
clientengineUnloadVehicleAudioConfigStops the calling resource's custom vehicle audio, restores GTA audio, and releases the global lease.
clientenginePlayVehicleAudioBackfireMake an active custom-audio vehicle backfire on demand. San Andreas Online plays the configured pop and, in full/flames mode, fires a normal or stronger burst from the exhaust.
client2 APIs
GTA radio playback
Read and restore the current GTA radio station, track, queue, and playback position.3 APIs
San Andreas Online visual settings
Read, change, and reset client visual options exposed by San Andreas Online.getNeonClientSettingReads one allowlisted effective San Andreas Online radar or SkyGFX setting.
clientsetNeonClientSettingApplies a resource-owned session override for an allowlisted San Andreas Online radar or SkyGFX setting.
clientresetNeonClientSettingsClears every San Andreas Online visual override owned by the calling resource.
client1 APIs
Open web links
Open an allowed HTTPS page in the player’s external browser.8 APIs
Server and compatibility
Verified player identity, bans, and extensions to existing MTA settings.
6 APIs
Player identity and bans
Read verified SA:O account and Discord identities and use them in server bans.isPlayerNeonAuthenticatedReports whether the server accepted a signed SA:O account ticket for this player connection.
servergetPlayerNeonIDReturns the verified global SA:O account UUID attached to a player connection.
servergetPlayerDiscordIDReturns the Discord identifier carried by a player's verified SA:O account ticket.
servergetBanNeonIDReads the SA:O account UUID stored on a server ban.
servergetBanDiscordIDReads the Discord identifier stored on a server ban.
serveraddBanEXTENSIONExtends MTA's existing ban constructor with optional verified SA:O account and Discord identity fields.
server2 APIs