PT-BR/Funções de Scripting do Servidor
Esta página lista todas as funções nativas conhecidas como server-side que estão disponíveis para uso. Para solicitar uma função ou um evento que ainda não existe, use a página Funções e Eventos solicitados (ainda em inglês) ou http://bugs.mtasa.com (também em inglês).
Lembre-se também que as funções podem ser estendidas ao carregar os módulos dinâmicos que disponibilizam novas funcionalidades, como funções utilitárias. Estas funções não são nativas e exigem que o módulo seja carregado para funcionarem.
Visite a página Módulos para ver a lista de funções server-side não nativas e os respectivos módulos que estão disponíveis.
Temos também uma lista com a implementação de diversas funções utilitárias que podem te auxiliar no dia-a-dia. Para conhecê-las, visite a página funções úteis
Procurando as funções client-side? Visite a página Funções de Scripting do Cliente.
Contents
- 1 Account (Conta)
- 2 ACL (Lista de Controle de Acesso)
- 3 Admin (Administração)
- 4 Audio (Áudio)
- 5 Announcement (Anúncio)
- 6 Blip (Ícone do radar)
- 7 Camera (Câmera)
- 8 Clothes and body (Roupas e corpo)
- 9 Collision shape (Forma de colisão)
- 10 Cursor (Cursor do mouse)
- 11 Element (Elementos)
- 12 Event (Eventos)
- 13 Explosion (Explosão)
- 14 File (Arquivo)
- 15 HTTP (Protocolo HTTP)
- 16 Input (Entrada)
- 17 Map (Mapa)
- 18 Marker (Marcador)
- 19 Matrix (Matriz)
- 20 Module (Módulo)
- 21 Object (Objeto)
- 22 Ped (Pedestre)
- 23 Pickup (Coletável)
- 24 Player (Jogador)
- 25 Projectile (Projétil)
- 26 Radar area (Área no radar)
- 27 Resource (Recurso)
- 28 Server (Servidor)
- 29 Settings registry (Registro de configuração)
- 30 SQL
- 31 Team (Time)
- 32 Text (Texto)
- 33 Utility (Utilidade)
- 34 UTF8 Library (Biblioteca UTF8)
- 35 Vehicle (Veículo)
- 36 Water (Água)
- 37 Weapon (Arma)
- 38 World (Mundo)
- 39 XML
Account (Conta)
- addAccount
- copyAccountData
- getAccount
- getAccountData
- getAccountName
- getAccountPlayer
- getAccountSerial
- getAccounts
- getAccountsBySerial
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- logOut
- removeAccount
- setAccountData
- setAccountPassword
ACL (Lista de Controle de Acesso)
- aclCreate
- aclCreateGroup
- aclDestroy
- aclDestroyGroup
- aclGet
- aclGetGroup
- aclGetName
- aclGetRight
- aclGroupAddACL
- aclGroupAddObject
- aclGroupGetName
- aclGroupList
- aclGroupListACL
- aclGroupListObjects
- aclGroupRemoveACL
- aclGroupRemoveObject
- aclList
- aclListRights
- aclReload
- aclRemoveRight
- aclSave
- aclSetRight
- hasObjectPermissionTo
- isObjectInACLGroup
Admin (Administração)
- addBan
- banPlayer
- getBanAdmin
- getBanIP
- getBanNick
- getBanReason
- getBanSerial
- getBanTime
- getBanUsername
- getBans
- getUnbanTime
- isBan
- kickPlayer
- setBanAdmin
- setBanNick
- setBanReason
- setUnbanTime
- reloadBans
- removeBan
Audio (Áudio)
Announcement (Anúncio)
Blip (Ícone do radar)
- createBlip
- createBlipAttachedTo
- getBlipColor
- getBlipIcon
- getBlipOrdering
- getBlipSize
- getBlipVisibleDistance
- setBlipColor
- setBlipIcon
- setBlipOrdering
- setBlipSize
- setBlipVisibleDistance
Camera (Câmera)
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget
Clothes and body (Roupas e corpo)
Collision shape (Forma de colisão)
Cursor (Cursor do mouse)
Element (Elementos)
- 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
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementVisibleTo
- isElementWithinColShape
- isElementWithinMarker
- removeElementData
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementSyncer
- setElementVelocity
- setElementVisibleTo
- setLowLODElement
Event (Eventos)
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getCancelReason
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- triggerClientEvent
- triggerLatentClientEvent
- wasEventCancelled
Explosion (Explosão)
File (Arquivo)
HTTP (Protocolo HTTP)
These functions can only be used from within lua blocks in HTML pages hosted by the server
- httpClear
- httpRequestLogin
- httpSetResponseCode
- httpSetResponseCookie
- httpSetResponseHeader
- httpWrite
Input (Entrada)
- addCommandHandler
- bindKey
- executeCommandHandler
- getCommandHandlers
- getControlState
- getFunctionsBoundToKey
- getKeyBoundToFunction
- isControlEnabled
- isKeyBound
- removeCommandHandler
- setControlState
- toggleAllControls
- toggleControl
- unbindKey
Map (Mapa)
Marker (Marcador)
- createMarker
- getMarkerColor
- getMarkerCount
- getMarkerIcon
- getMarkerSize
- getMarkerTarget
- getMarkerType
- setMarkerColor
- setMarkerIcon
- setMarkerSize
- setMarkerTarget
- setMarkerType
Matrix (Matriz)
Module (Módulo)
Object (Objeto)
Ped (Pedestre)
- 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
Pickup (Coletável)
- createPickup
- getPickupAmmo
- getPickupAmount
- getPickupRespawnInterval
- getPickupType
- getPickupWeapon
- isPickupSpawned
- setPickupRespawnInterval
- setPickupType
- usePickup
Player (Jogador)
- forcePlayerMap
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerBlurLevel
- getPlayerCount
- getPlayerFromName
- getPlayerIdleTime
- getPlayerIP
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerSerial
- getPlayerTeam
- getPlayerVersion
- getPlayerWantedLevel
- getRandomPlayer
- givePlayerMoney
- isPlayerMapForced
- isPlayerMuted
- isPlayerNametagShowing
- isVoiceEnabled
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerBlurLevel
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerMuted
- setPlayerName
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerMoney
- takePlayerScreenShot
Projectile (Projétil)
Radar area (Área no radar)
- createRadarArea
- getRadarAreaColor
- getRadarAreaSize
- isInsideRadarArea
- isRadarAreaFlashing
- setRadarAreaColor
- setRadarAreaFlashing
- setRadarAreaSize
Resource (Recurso)
- addResourceConfig
- addResourceMap
- call
- callRemote
- copyResource
- createResource
- deleteResource
- fetchRemote
- getResourceACLRequests
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceInfo
- getResourceLastStartTime
- getResourceLoadFailureReason
- getResourceLoadTime
- getResourceMapRootElement
- getResourceName
- getResourceOrganizationalPath
- getResourceRootElement
- getResourceState
- getResources
- getThisResource
- isResourceArchived
- refreshResources
- removeResourceFile
- renameResource
- restartResource
- setResourceInfo
- startResource
- stopResource
- updateResourceACLRequest
- getRemoteRequests
- getRemoteRequestInfo
- abortRemoteRequest
Server (Servidor)
- getFPSLimit
- getMaxPlayers
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- getVersion
- isGlitchEnabled
- setFPSLimit
- setGlitchEnabled
- setMaxPlayers
- setServerPassword
- shutdown
Settings registry (Registro de configuração)
SQL
Team (Time)
- countPlayersInTeam
- createTeam
- getPlayerTeam
- getPlayersInTeam
- getTeamColor
- getTeamFriendlyFire
- getTeamFromName
- getTeamName
- setPlayerTeam
- setTeamColor
- setTeamFriendlyFire
- setTeamName
Text (Texto)
- textCreateDisplay
- textCreateTextItem
- textDestroyDisplay
- textDestroyTextItem
- textDisplayAddObserver
- textDisplayAddText
- textDisplayGetObservers
- textDisplayIsObserver
- textDisplayRemoveObserver
- textDisplayRemoveText
- textItemGetColor
- textItemGetPosition
- textItemGetPriority
- textItemGetScale
- textItemGetText
- textItemSetColor
- textItemSetPosition
- textItemSetPriority
- textItemSetScale
- textItemSetText
Utility (Utilidade)
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace
- debugSleep
- decodeString
- encodeString
- fromJSON
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getFPSLimit
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getServerConfigSetting
- getTickCount
- getTimerDetails
- getTimers
- gettok
- getUserdataType
- getVersion
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setServerConfigSetting
- setTimer
- sha256
- split
- teaDecode
- teaEncode
UTF8 Library (Biblioteca UTF8)
- 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 (Veículo)
- 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
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- getVehiclesOfType
- 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
- setVehicleTurretPosition
Water (Água)
- createWater
- getWaterColor
- getWaterVertexPosition
- getWaveHeight
- resetWaterColor
- resetWaterLevel
- setWaterColor
- setWaterLevel
- setWaterVertexPosition
- setWaveHeight
Weapon (Arma)
- getOriginalWeaponProperty
- getSlotFromWeapon
- getWeaponIDFromName
- getWeaponNameFromID
- getWeaponProperty
- giveWeapon
- setWeaponAmmo
- setWeaponProperty
- takeAllWeapons
- takeWeapon
World (Mundo)
- areTrafficLightsLocked
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getJetpackMaxHeight
- getJetpackWeaponEnabled
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSkyGradient
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setJetpackWeaponEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity