Server Scripting Functions: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(25 intermediate revisions by 5 users not shown)
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.
For more functions, check the [[Useful_Functions|useful functions page]].
'''Client-side scripting functions can be found here: [[Client Scripting Functions]].'''
__TOC__
==Account functions==
{{Account functions}}
==ACL functions==
{{ACL functions}}
==Admin functions==
{{Admin functions}}
==Audio functions==
'''Shared'''
{{Audio functions}}


Head over to Modules for a list of non-native serverside functions and modules that are available.
==Announcement functions==
{{Announce functions}}
==Blip functions==
'''Shared'''
{{Blip functions}}


For more functions, check the useful functions page.
==Camera functions==
'''Shared'''
{{Camera functions}}


Client-side scripting functions can be found here: Client Scripting Functions.
==Clothes and body functions==
'''Shared'''
{{Clothes and body functions}}


==Collision shape functions==
'''Shared'''
{{Collision shape functions}}


Contents
==Cursor functions==
Account functions
'''Shared'''
addAccount
{{Cursor functions}}
copyAccountData
getAccount
getAccountData
getAccountName
getAccountPlayer
getAccountSerial
getAccounts
getAccountsBySerial
getAllAccountData
getPlayerAccount
isGuestAccount
logIn
logOut
removeAccount
setAccountData
setAccountPassword
getAccountByID
getAccountID
getAccountIP
getAccountsByData
getAccountsByIP
setAccountName


ACL functions
==Element functions==
aclCreate
{{Element functions|server}}
aclCreateGroup
aclDestroy
==Event functions==
aclDestroyGroup
{{Event functions|server}}
aclGet
aclGetGroup
==Explosion functions==
aclGetName
'''Shared'''
aclGetRight
{{Explosion functions}}
aclGroupAddACL
aclGroupAddObject
aclGroupGetName
aclGroupList
aclGroupListACL
aclGroupListObjects
aclGroupRemoveACL
aclGroupRemoveObject
aclList
aclListRights
aclReload
aclRemoveRight
aclSave
aclSetRight
hasObjectPermissionTo
isObjectInACLGroup


Admin functions
==File functions==
addBan
'''Shared'''
banPlayer
{{File functions}}
getBanAdmin
getBanIP
getBanNick
getBanReason
getBanSerial
getBanTime
getBanUsername
getBans
getUnbanTime
isBan
kickPlayer
setBanAdmin
setBanNick
setBanReason
setUnbanTime
reloadBans
removeBan


Audio functions
==HTTP functions==
playSoundFrontEnd
{{HTTP functions}}
==Input functions==
{{Input functions|server}}
==Map functions==
{{Map functions}}
==Marker functions==
'''Shared'''
{{Marker functions}}


Announcement functions
==Matrix functions==
getGameType
'''Shared'''
getMapName
{{Matrix functions}}
getRuleValue
removeRuleValue
setGameType
setMapName
setRuleValue


Blip functions
==Module functions==
createBlip
{{Module functions}}
createBlipAttachedTo
getBlipColor
==Object functions==
getBlipIcon
'''Shared'''
getBlipOrdering
{{Object functions}}
getBlipSize
getBlipVisibleDistance
setBlipColor
setBlipIcon
setBlipOrdering
setBlipSize
setBlipVisibleDistance


Camera functions
==Output functions==
fadeCamera
{{Output functions|server}}
getCameraInterior
getCameraMatrix
==Ped functions==
getCameraTarget
{{Ped functions|server}}
setCameraInterior
setCameraMatrix
==Pickup functions==
setCameraTarget
{{Pickup functions|server}}
==Player functions==
{{Player functions|server}}
==Projectile functions==
'''Shared'''
{{Projectile_functions}}


Clothes and body functions
==Radar area functions==
getBodyPartName
'''Shared'''
getClothesByTypeIndex
{{Radar functions}}
getClothesTypeName
getTypeIndexFromClothes


Collision shape functions
==Resource functions==
addColPolygonPoint
{{Resource functions|server}}
createColCircle
createColCuboid
==Server functions==
createColPolygon
{{Server functions}}
createColRectangle
createColSphere
==Settings registry functions==
createColTube
{{Settings registry functions}}
* FEATURE ADDED IN 1.5.9 (REVISION: r20807)
getColPolygonHeight
==SQL functions==
getColPolygonPoints
{{SQL functions}}
getColPolygonPointPosition
getColShapeType
==Team functions==
getColShapeRadius
{{Team functions|server}}
getColShapeSize
getElementColShape
==Text functions==
getElementsWithinColShape
{{Text functions}}
isElementWithinColShape
isInsideColShape
==Utility functions==
removeColPolygonPoint
{{Utility functions|server}}
* FEATURE ADDED IN 1.5.9 (REVISION: r20807)
setColPolygonHeight
==UTF8 Library==
setColPolygonPointPosition
'''Shared'''
setColShapeRadius
{{UTF8 functions}}
setColShapeSize
==Vehicle functions==
{{Vehicle functions|server}}
==Water functions==
'''Shared'''
{{Water functions}}


Cursor functions
==Weapon functions==
isCursorShowing
{{Weapon functions|server}}
showCursor
==World functions==
{{World functions|server}}
==XML functions==
'''Shared'''
{{XML functions}}


Element functions
[[ar:Server Scripting Functions]]
addElementDataSubscriber
[[de:Server-Seitige Scripting Funktionen]]
attachElements
[[en:Server Scripting Functions]]
clearElementVisibleTo
[[es:Funciones_del_Server]]
cloneElement
[[hu:Server Scripting Functions]]
createElement
[[pl:Server Scripting Functions]]
destroyElement
[[pt-br:Funções de Scripting do Servidor]]
detachElements
[[ru:Server Scripting Functions]]
getAllElementData
[[tr:Server Scripting Functions]]
getAttachedElements
[[zh-cn:Server Scripting Functions]]
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(+)

Latest revision as of 22:34, 6 September 2024

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

Shared



Announcement functions


Blip functions

Shared


Camera functions

Shared



Clothes and body functions

Shared


Collision shape functions

Shared


Cursor functions

Shared



Element functions



Event functions



Explosion functions

Shared


File functions

Shared


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

Shared



Matrix functions

Shared


Module functions


Object functions

Shared



Output functions



Ped functions



Pickup functions



Player functions



Projectile functions

Shared



Radar area functions

Shared


Resource functions



Server functions


Settings registry functions


SQL functions


Team functions



Text functions


Utility functions



UTF8 Library

Shared


Vehicle functions



Water functions

Shared



Weapon functions



World functions



XML functions

Shared