Server Scripting Functions: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(πŸ“’ Attention, fellow users! Please refrain from making random edits to this wiki page. It is essential to maintain the integrity and accuracy of the information presented here. Random edits can lead to misinformation, confusion, and a loss of trust in the content.)
Tags: Undo Reverted
(πŸ“’ Attention, fellow users! Please refrain from making random edits to this wiki page. It is essential to maintain the integrity and accuracy of the information presented here. Random edits can lead to misinformation, confusion, and a loss of trust in the content.)
Tags: Manual revert Reverted
Line 1: Line 1:
Server Scripting Functions
<pageclass class="server"></pageclass>
Jump to navigationJump to search
{{Adding_Pages_to_Categories_and_Templates}}
Contributors: Did you create a page but it's not on this list? Confused? Read: Adding Pages to Categories and Templates
This page lists all the '''server-side''' scripting functions that have been implemented and are available as native functions. To request a function, create an issue in [https://github.com/multitheftauto/mtasa-blue/issues our GitHub repository.]
This page lists all the server-side scripting functions that have been implemented and are available as native functions. To request a function, create an issue in our GitHub repository.


Please note that the scripting functions can also be extended by loading in dynamic modules that provide new functionality, such as utility functions. These scripting functions are non-native and require the module to be loaded in order to work.
Please note that the scripting functions can also be extended by loading in dynamic modules that provide new functionality, such as utility functions. These scripting functions are non-native and require the module to be loaded in order to work.
Β 
Head over to Modules for a list of non-native serverside functions and modules that are available.
Head over to [[Modules]] for a list of non-native serverside functions and modules that are available.
Β 
For more functions, check the useful functions page.
For more functions, check the [[Useful_Functions|useful functions page]].
Β 
Client-side scripting functions can be found here: Client Scripting Functions.
'''Client-side scripting functions can be found here: [[Client Scripting Functions]].'''
Β 
__TOC__
Β 
Contents
==Account functions==
Account functions
{{Account_functions}}
addAccount
copyAccountData
==ACL functions==
[[getAccount]]
{{ACL_functions}}
getAccountData
getAccountName
==Admin functions==
getAccountPlayer
{{Admin_functions}}
getAccountSerial
getAccounts
==Audio functions==
getAccountsBySerial
{{Audio_functions}}
getAllAccountData
getPlayerAccount
==Announcement functions==
isGuestAccount
{{Announce_functions}}
logIn
logOut
==Blip functions==
removeAccount
{{Blip_functions}}
setAccountData
setAccountPassword
==Camera functions==
getAccountByID
{{Camera_functions}}
getAccountID
getAccountIP
==Clothes and body functions==
getAccountsByData
{{Clothes_and_body_functions}}
getAccountsByIP
setAccountName
==Collision shape functions==
Β 
{{Collision_shape_functions}}
ACL functions
aclCreate
==Cursor functions==
aclCreateGroup
{{Cursor_functions}}
aclDestroy
aclDestroyGroup
==Element functions==
aclGet
{{Element_functions}}
aclGetGroup
aclGetName
==Event functions==
aclGetRight
{{Event_functions}}
aclGroupAddACL
aclGroupAddObject
==Explosion functions==
aclGroupGetName
{{Explosion_functions}}
aclGroupList
aclGroupListACL
==File functions==
aclGroupListObjects
{{File_functions}}
aclGroupRemoveACL
aclGroupRemoveObject
==HTTP functions==
aclList
{{HTTP_functions}}
aclListRights
aclReload
==Input functions==
aclRemoveRight
{{Input_functions}}
aclSave
aclSetRight
==Map functions==
hasObjectPermissionTo
{{Map_functions}}
isObjectInACLGroup
Β 
==Marker functions==
Admin functions
{{Marker_functions}}
addBan
banPlayer
==Matrix functions==
getBanAdmin
{{Shared_matrix_functions}}
getBanIP
getBanNick
==Module functions==
getBanReason
{{Module_functions}}
getBanSerial
getBanTime
==Object functions==
getBanUsername
{{Object_functions}}
getBans
getUnbanTime
==Output functions==
isBan
{{Output_functions}}
kickPlayer
setBanAdmin
==Ped functions==
setBanNick
{{Ped_functions}}
setBanReason
setUnbanTime
==Pickup functions==
reloadBans
{{Pickup_functions}}
removeBan
Β 
==Player functions==
Audio functions
{{Player_functions}}
playSoundFrontEnd
Β 
==Projectile functions==
Announcement functions
{{Projectile_functions}}
getGameType
getMapName
==Radar area functions==
getRuleValue
{{Radar_area_functions}}
removeRuleValue
setGameType
==Resource functions==
setMapName
{{Resource_functions}}
setRuleValue
Β 
==Server functions==
Blip functions
{{Server_functions}}
createBlip
createBlipAttachedTo
==Settings registry functions==
getBlipColor
{{Settings_registry_functions}}
getBlipIcon
getBlipOrdering
==SQL functions==
getBlipSize
{{SQL_functions}}
getBlipVisibleDistance
setBlipColor
==Team functions==
setBlipIcon
{{Team_functions}}
setBlipOrdering
setBlipSize
==Text functions==
setBlipVisibleDistance
{{Text_functions}}
Β 
Camera functions
==Utility functions==
fadeCamera
{{Utility_functions}}
getCameraInterior
getCameraMatrix
==UTF8 Library==
getCameraTarget
{{UTF8_functions}}
setCameraInterior
setCameraMatrix
==Vehicle functions==
setCameraTarget
{{Vehicle_functions}}
Β 
Clothes and body functions
==Water functions==
getBodyPartName
{{Water_functions}}
getClothesByTypeIndex
getClothesTypeName
==Weapon functions==
getTypeIndexFromClothes
{{Weapon_functions}}
Β 
Collision shape functions
==World functions==
addColPolygonPoint
{{World_functions}}
createColCircle
createColCuboid
==XML functions==
createColPolygon
{{XML_functions}}
createColRectangle
createColSphere
[[en:Server Scripting Functions]]
createColTube
[[ru:Server Scripting Functions]]
* FEATURE ADDED IN 1.5.9 (REVISION: r20807)
[[hu:Server Scripting Functions]]
getColPolygonHeight
[[de:Server-Seitige Scripting Funktionen]]
getColPolygonPoints
[[es:Funciones_del_Server]]
getColPolygonPointPosition
[[pl:Server Scripting Functions]]
getColShapeType
[[pt-br:Funçáes de Scripting do Servidor]]
getColShapeRadius
[[tr:Server Scripting Functions]]
getColShapeSize
[[ar:Server Scripting Functions]]
getElementColShape
[[zh-cn:Server Scripting Functions]]
getElementsWithinColShape
isElementWithinColShape
isInsideColShape
removeColPolygonPoint
* FEATURE ADDED IN 1.5.9 (REVISION: r20807)
setColPolygonHeight
setColPolygonPointPosition
setColShapeRadius
setColShapeSize
Β 
Cursor functions
isCursorShowing
showCursor
Β 
Element functions
addElementDataSubscriber
attachElements
clearElementVisibleTo
cloneElement
createElement
destroyElement
detachElements
getAllElementData
getAttachedElements
getElementAlpha
getElementAttachedOffsets
getElementAttachedTo
getElementCollisionsEnabled
getElementByID
getElementByIndex
getElementChild
getElementChildren
getElementChildrenCount
getElementColShape
getElementData
getElementDimension
getElementHealth
getElementID
getElementInterior
getElementMatrix
getElementModel
getElementParent
getElementPosition
getElementRotation
getElementSyncer
getElementType
getElementVelocity
getElementZoneName
getElementsByType
getElementsWithinColShape
getElementsWithinRange
getLowLODElement
getRootElement
hasElementData
hasElementDataSubscriber
isElement
isElementAttached
isElementCallPropagationEnabled
isElementDoubleSided
isElementFrozen
isElementInWater
isElementLowLOD
isElementVisibleTo
isElementWithinColShape
isElementWithinMarker
removeElementData
removeElementDataSubscriber
setElementAlpha
setElementAngularVelocity
getElementAngularVelocity
setElementAttachedOffsets
setElementCallPropagationEnabled
setElementCollisionsEnabled
setElementData
setElementDimension
setElementDoubleSided
setElementFrozen
setElementHealth
setElementID
setElementInterior
setElementModel
setElementParent
setElementPosition
setElementRotation
setElementSyncer
setElementVelocity
setElementVisibleTo
setLowLODElement
Β 
Event functions
addEvent
addEventHandler
cancelEvent
cancelLatentEvent
getCancelReason
getEventHandlers
getLatentEventHandles
getLatentEventStatus
removeEventHandler
triggerEvent
triggerClientEvent
triggerLatentClientEvent
wasEventCancelled
Β 
Explosion functions
createExplosion
Β 
File functions
fileClose
fileCopy
fileCreate
fileDelete
fileExists
fileFlush
fileGetPath
fileGetPos
fileGetSize
fileIsEOF
fileOpen
fileRead
fileRename
fileSetPos
fileWrite
Β 
HTTP functions
These functions can only be used from within lua blocks in HTML pages hosted by the server
Β 
httpClear
httpRequestLogin
httpSetResponseCode
httpSetResponseCookie
httpSetResponseHeader
httpWrite
Β 
Input functions
addCommandHandler
bindKey
executeCommandHandler
getCommandHandlers
getControlState
getFunctionsBoundToKey
getKeyBoundToFunction
isControlEnabled
isKeyBound
removeCommandHandler
setControlState
toggleAllControls
toggleControl
unbindKey
Β 
Map functions
loadMapData
resetMapInfo
saveMapData
Β 
Marker functions
createMarker
getMarkerColor
getMarkerCount
getMarkerIcon
getMarkerSize
getMarkerTarget
getMarkerType
setMarkerColor
setMarkerIcon
setMarkerSize
setMarkerTarget
setMarkerType
Β 
Matrix functions
Matrix
Vector/Vector2
Vector/Vector3
Vector/Vector4
Β 
Module functions
getLoadedModules
getModuleInfo
Β 
Object functions
createObject
getObjectScale
moveObject
setObjectScale
stopObject
ADDED/UPDATED IN VERSION 1.6.0 r21765:
isObjectBreakable
setObjectBreakable
Β 
Output functions
clearChatBox
outputChatBox
outputConsole
outputDebugString
outputServerLog
showChat
Β 
Ped functions
addPedClothes
createPed
getPedAmmoInClip
getPedArmor
getPedClothes
getPedContactElement
getPedFightingStyle
getPedGravity
getPedOccupiedVehicle
getPedOccupiedVehicleSeat
getPedStat
getPedTarget
getPedTotalAmmo
getPedWalkingStyle
getPedWeapon
getPedWeaponSlot
getValidPedModels
isPedChoking
isPedDead
isPedDoingGangDriveby
isPedDucked
isPedHeadless
isPedInVehicle
isPedOnFire
isPedOnGround
isPedWearingJetpack
killPed
reloadPedWeapon
removePedClothes
removePedFromVehicle
setPedAnimation
setPedAnimationProgress
setPedAnimationSpeed
setPedArmor
setPedChoking
setPedDoingGangDriveby
setPedFightingStyle
setPedGravity
setPedHeadless
setPedOnFire
setPedStat
setPedWalkingStyle
setPedWeaponSlot
setPedWearingJetpack
warpPedIntoVehicle
Β 
Pickup functions
createPickup
getPickupAmmo
getPickupAmount
getPickupRespawnInterval
getPickupType
getPickupWeapon
isPickupSpawned
setPickupRespawnInterval
setPickupType
usePickup
Β 
Player functions
forcePlayerMap
getAlivePlayers
getDeadPlayers
getPlayerACInfo
getPlayerAnnounceValue
getPlayerBlurLevel
getPlayerCount
getPlayerFromName
getPlayerIdleTime
getPlayerIP
getPlayerMoney
getPlayerName
getPlayerNametagColor
getPlayerNametagText
getPlayerPing
getPlayerScriptDebugLevel
getPlayerSerial
getPlayerTeam
getPlayerVersion
getPlayerWantedLevel
getRandomPlayer
givePlayerMoney
isPlayerMapForced
isPlayerMuted
isPlayerNametagShowing
isVoiceEnabled
redirectPlayer
resendPlayerACInfo
resendPlayerModInfo
setPlayerAnnounceValue
setPlayerBlurLevel
setPlayerHudComponentVisible
setPlayerMoney
setPlayerMuted
setPlayerName
setPlayerNametagColor
setPlayerNametagShowing
setPlayerNametagText
setPlayerScriptDebugLevel
setPlayerTeam
setPlayerVoiceBroadcastTo
setPlayerVoiceIgnoreFrom
setPlayerWantedLevel
spawnPlayer
takePlayerMoney
takePlayerScreenShot
Β 
Projectile functions
detonateSatchels
Β 
Radar area functions
createRadarArea
getRadarAreaColor
getRadarAreaSize
isInsideRadarArea
isRadarAreaFlashing
setRadarAreaColor
setRadarAreaFlashing
setRadarAreaSize
Β 
Resource functions
abortRemoteRequest
addResourceConfig
addResourceMap
call
callRemote
copyResource
createResource
deleteResource
fetchRemote
getRemoteRequestInfo
getRemoteRequests
getResourceACLRequests
getResourceConfig
getResourceDynamicElementRoot
getResourceExportedFunctions
getResourceFromName
getResourceInfo
getResourceLastStartTime
getResourceLoadFailureReason
getResourceLoadTime
getResourceMapRootElement
getResourceName
getResourceOrganizationalPath
getResourceRootElement
getResources
getResourceState
getThisResource
isResourceArchived
isResourceProtected
refreshResources
removeResourceFile
renameResource
restartResource
setResourceInfo
startResource
stopResource
updateResourceACLRequest
Β 
Server functions
getFPSLimit
getMaxPlayers
getServerHttpPort
getServerName
getServerPassword
getServerPort
getVersion
isGlitchEnabled
* FEATURE ADDED IN 1.5.9 (REVISION: r20788)
isTransferBoxAlwaysVisible
isTransferBoxVisible
setFPSLimit
setGlitchEnabled
setMaxPlayers
setServerPassword
* FEATURE ADDED IN 1.5.9 (REVISION: r20788)
setTransferBoxVisible
shutdown
Β 
Settings registry functions
get
set
Β 
SQL functions
executeSQLQuery
dbConnect
dbExec
dbFree
dbPoll
dbPrepareString
dbQuery
Β 
Team functions
countPlayersInTeam
createTeam
getPlayerTeam
getPlayersInTeam
getTeamColor
getTeamFriendlyFire
getTeamFromName
getTeamName
setPlayerTeam
setTeamColor
setTeamFriendlyFire
setTeamName
Β 
Text functions
textCreateDisplay
textCreateTextItem
textDestroyDisplay
textDestroyTextItem
textDisplayAddObserver
textDisplayAddText
textDisplayGetObservers
textDisplayIsObserver
textDisplayRemoveObserver
textDisplayRemoveText
textItemGetColor
textItemGetPosition
textItemGetPriority
textItemGetScale
textItemGetText
textItemSetColor
textItemSetPosition
textItemSetPriority
textItemSetScale
textItemSetText
Β 
Utility functions
addDebugHook
base64Decode
base64Encode
bitAnd
bitNot
bitOr
bitXor
bitTest
bitLRotate
bitRRotate
bitLShift
bitRShift
bitArShift
bitExtract
bitReplace
debugSleep
decodeString
deref
encodeString
fromJSON
BETA: NEW FEATURE (BUILD: 1.5.9 r21055)
generateKeyPair
getColorFromString
getDevelopmentMode
getDistanceBetweenPoints2D
getDistanceBetweenPoints3D
getEasingValue
getFPSLimit
getNetworkStats
getNetworkUsageData
getPerformanceStats
BETA: NEW FEATURE (BUILD: 1.5.9 r21389)
getProcessMemoryStats
getRealTime
getServerConfigSetting
getTickCount
getTimerDetails
getTimers
gettok
getUserdataType
getVersion
hash
inspect
interpolateBetween
iprint
isOOPEnabled
isTimer
killTimer
md5
passwordHash
passwordVerify
pregFind
pregMatch
pregReplace
removeDebugHook
ref
resetTimer
setDevelopmentMode
setFPSLimit
setServerConfigSetting
setTimer
sha256
split
teaDecode
teaEncode
tocolor
toJSON
utfChar
utfCode
utfLen
utfSeek
utfSub
Β 
UTF8 Library
utf8.byte
utf8.char
utf8.charpos
utf8.escape
utf8.find
utf8.fold
utf8.gmatch
utf8.gsub
utf8.insert
utf8.len
utf8.lower
utf8.match
utf8.ncasecmp
utf8.next
utf8.remove
utf8.reverse
utf8.sub
utf8.title
utf8.upper
utf8.width
utf8.widthindex
Β 
Vehicle functions
addVehicleSirens
addVehicleUpgrade
attachTrailerToVehicle
blowVehicle
createVehicle
detachTrailerFromVehicle
fixVehicle
getModelHandling
getOriginalHandling
getTrainDirection
getTrainPosition
getTrainSpeed
getVehicleColor
getVehicleCompatibleUpgrades
getVehicleController
getVehicleDoorOpenRatio
getVehicleDoorState
getVehicleEngineState
getVehicleHandling
getVehicleHeadLightColor
getVehicleLandingGearDown
getVehicleLightState
getVehicleMaxPassengers
getVehicleModelFromName
getVehicleName
getVehicleNameFromModel
getVehicleOccupant
getVehicleOccupants
getVehicleOverrideLights
getVehiclePaintjob
getVehiclePanelState
getVehiclePlateText
getVehicleRespawnPosition
getVehicleRespawnRotation
getVehicleSirenParams
getVehicleSirens
getVehicleSirensOn
getVehiclesOfType
getVehicleTowedByVehicle
getVehicleTowingVehicle
BEFORE VERSION 1.5.6 :
getVehicleTurnVelocity
getVehicleTurretPosition
getVehicleType
getVehicleUpgradeOnSlot
getVehicleUpgrades
getVehicleUpgradeSlotName
getVehicleVariant
getVehicleWheelStates
isTrainDerailable
isTrainDerailed
isVehicleBlown
isVehicleDamageProof
isVehicleFuelTankExplodable
isVehicleLocked
isVehicleOnGround
isVehicleTaxiLightOn
removeVehicleSirens
removeVehicleUpgrade
resetVehicleExplosionTime
resetVehicleIdleTime
respawnVehicle
setModelHandling
setTrainDerailable
setTrainDerailed
setTrainDirection
setTrainPosition
setTrainSpeed
setVehicleColor
setVehicleDamageProof
setVehicleDoorOpenRatio
setVehicleDoorState
setVehicleDoorsUndamageable
setVehicleEngineState
setVehicleFuelTankExplodable
setVehicleHandling
setVehicleHeadLightColor
setVehicleIdleRespawnDelay
setVehicleLandingGearDown
setVehicleLightState
setVehicleLocked
setVehicleOverrideLights
setVehiclePaintjob
setVehiclePanelState
setVehiclePlateText
setVehicleRespawnDelay
setVehicleRespawnPosition
setVehicleRespawnRotation
setVehicleSirens
setVehicleSirensOn
setVehicleTaxiLightOn
BEFORE VERSION 1.5.6 :
setVehicleTurnVelocity
setVehicleTurretPosition
* FEATURE UPDATED IN 1.5.9 (REVISION: r20693)
setVehicleVariant
setVehicleWheelStates
spawnVehicle
toggleVehicleRespawn
Β 
Water functions
createWater
getWaterColor
getWaterVertexPosition
getWaveHeight
resetWaterColor
resetWaterLevel
setWaterColor
setWaterLevel
setWaterVertexPosition
setWaveHeight
Β 
Weapon functions
getOriginalWeaponProperty
getSlotFromWeapon
getWeaponIDFromName
getWeaponNameFromID
getWeaponProperty
giveWeapon
setWeaponAmmo
setWeaponProperty
takeAllWeapons
takeWeapon
Β 
World functions
areTrafficLightsLocked
getAircraftMaxVelocity
getCloudsEnabled
getFarClipDistance
getFogDistance
getGameSpeed
getGravity
getHeatHaze
getJetpackMaxHeight
getJetpackWeaponEnabled
getMinuteDuration
getMoonSize
getOcclusionsEnabled
getRainLevel
getSkyGradient
getSunColor
getSunSize
getTime
getTrafficLightState
getWeather
getWindVelocity
getZoneName
isGarageOpen
removeWorldModel
* FEATURE ADDED IN 1.5.9 (REVISION: r20718)
resetColorFilter
resetFarClipDistance
resetFogDistance
resetHeatHaze
resetMoonSize
resetRainLevel
resetSkyGradient
resetSunColor
resetSunSize
resetWindVelocity
restoreAllWorldModels
restoreWorldModel
setAircraftMaxVelocity
setCloudsEnabled
* FEATURE ADDED IN 1.5.9 (REVISION: r20718)
setColorFilter
setFarClipDistance
setFogDistance
setGameSpeed
setGarageOpen
setGravity
setHeatHaze
setInteriorSoundsEnabled
setJetpackWeaponEnabled
setMinuteDuration
setMoonSize
setOcclusionsEnabled
setRainLevel
setSkyGradient
setSunColor
setSunSize
setTime
setTrafficLightState
setTrafficLightsLocked
setWeather
setWeatherBlended
setWindVelocity
Β 
XML functions
xmlCopyFile
xmlCreateChild
xmlCreateFile
xmlDestroyNode
xmlFindChild
xmlLoadFile
xmlLoadString
xmlNodeGetAttribute
xmlNodeGetAttributes
xmlNodeGetChildren
xmlNodeGetName
xmlNodeGetParent
xmlNodeGetValue
xmlNodeSetAttribute
xmlNodeSetName
xmlNodeSetValue
xmlSaveFile
xmlUnloadFile
Category (++): Changes in 1.5.9(+)

Revision as of 03:02, 15 June 2023

Contributors: Did you create a page but it's not on this list? Confused? Read: Adding Pages to Categories and Templates

This page lists all the server-side scripting functions that have been implemented and are available as native functions. To request a function, create an issue in our GitHub repository.

Please note that the scripting functions can also be extended by loading in dynamic modules that provide new functionality, such as utility functions. These scripting functions are non-native and require the module to be loaded in order to work.

Head over to Modules for a list of non-native serverside functions and modules that are available.

For more functions, check the useful functions page.

Client-side scripting functions can be found here: Client Scripting Functions.

Account functions


ACL functions


Admin functions


Audio functions



Announcement functions


Blip functions


Camera functions



Clothes and body functions


Collision shape functions


Cursor functions



Element functions



Event functions



Explosion functions


File functions


HTTP functions

These functions can only be used from within lua blocks in HTML pages hosted by the server


Input functions



Map functions


Marker functions



Matrix functions


Module functions


Object functions



Output functions



Ped functions



Pickup functions



Player functions



Projectile functions



Radar area functions


Resource functions



Server functions


Settings registry functions


SQL functions


Team functions



Text functions


Utility functions



UTF8 Library


Vehicle functions



Water functions



Weapon functions



World functions



XML functions