Jump to content

Fourm's Lua script


Recommended Posts

23 hours ago, Jusonex said:

Thanks for your feedback! We're currently implementing a plugin that adds wiki links just like phpBB did it.

For the meantime (or in general) there is a "MTA Wiki Link" button in the editor though.

This would be awesome if he had the lua script as the one was in the old forum.

and i was woundaring if i can hide my logging in?

We are really appreciating what you are doing in here guys!

 

 

Edited by Mr.Pres[T]ege
  • Like 2
Link to comment
6 hours ago, darkdreamingdan said:

I'm happy to report we've now developed and installed this plugin.  Here's an example:


function onWasted() 
  if not( isGuestAccount (getPlayerAccount(source)) ) then 
    local jailtime = getAccountData(getPlayerAccount(source), "Jailtime" ) or 0 
    local theWeapon = getPedWeapon (source) 
    local weaponAmmo = getPedTotalAmmo (source) 
    if tonumber(jailtime) == nil or 0 then 
    outputChatBox ("1", root) 
    fadeCamera (source, false) 
    setTimer (spawnPlayer, 1000, 1, source, 1161.3000488281, -1376.0999755859, 4, 0, getPedSkin (source), 0, 0, getPlayerTeam(source)) 
    setTimer (setElementHealth, 1500, 1, source, 10) 
    setTimer (setCameraTarget, 1250, 1, source, source) 
    setTimer (fadeCamera, 2000, 1, source, true) 
    setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true) 
    elseif tonumber(jailtime) > 0 then 
    outputChatBox ("2", root) 
    fadeCamera (source, false) 
    setTimer (spawnPlayer, 1000, 1, source, 264.20001220703, 77.599998474121, 1001, 0, getPedSkin (source), 6, 1, getPlayerTeam(source)) 
    setTimer (portjail, 1500, 1) 
    setTimer (setElementHealth, 1500, 1, source, 10) 
    setTimer (setCameraTarget, 1250, 1, source, source) 
    setTimer (fadeCamera, 2000, 1, source, true) 
    setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true) 
    end 
  end 
end 
addEventHandler ("onPlayerWasted", getRootElement(), onWasted) 

As a bonus feature that didn't exist before, Event names are also linked to the wiki. All previous posts have this applied automatically, and all posts going forward.

Note, Wiki links and extended markup will only appear after you've posted the code.  Posting code is done normally by pressing the '<>' button in the post editor.

Please report any issues surrounding the syntax highlighting in this topic

 

This a great job you have done exactly as we wanted, I have a suggestion, a Select All and copies the code in there, if possible, add it and will become an integrated!

  • Like 1
Link to comment
19 minutes ago, darkdreamingdan said:

Yeah.i just never expected anyone coding on mobile O.o.  Why do you want it on mobile?

I have been doing it, i think anyone mught do it. I want to help people in anytime and anywhere with pc or mobile. Thats why i post  suggestion based on mobile side

everithing just need to get easy in hand

Edited by NeverGiveup
  • Like 2
Link to comment
56 minutes ago, Mr.Pres[T]ege said:

 @darkdreamingdan

Also some people asking to write code's on mobile so if you can add it as he said then it would be great and i'm still saying we need to select all button a large code will be hard to select it all by ur self would be much easier if we just pressed that button and selected all what in there! ;)

you are requesting way too much.

I don't know if that is even possible.. unless they add a custom button or so.

Link to comment
  • 2 weeks later...

@darkdreamingdan

Hi dan, in fact i think there's a problem with the plugin some functions aren't including in the plugin?

That's what i found when i tried to post about account's functions using the plugin.

addAccount
getAccountData
getAccountName
removeAccount
setAccountData

 

UPDATE :

 

addAccount
copyAccountData
getAccountData
getAccountName
getAccountPlayer
getAccountsBySerial
getAccountSerial
getAccounts
getAccount
getAllAccountData
getPlayerAccount
isGuestAccount
logIn
logOut
removeAccount
setAccountData
setAccountPassword


aclReload
aclSave
aclList
aclGet
aclCreate
aclDestroy
aclGetName
aclGetRight
aclSetRight
aclListRights
aclRemoveRight
aclGetGroup
aclCreateGroup
aclDestroyGroup
aclGroupList
aclGroupAddACL
aclGroupAddObject
aclGroupGetName
aclGroupListACL
aclGroupListObjects
aclGroupRemoveACL
aclGroupRemoveObject
hasObjectPermissionTo
isObjectInACLGroup

addBan
banPlayer
getBanAdmin
getBanIP
getBanNick
getBanReason
getBans
getBanSerial
getBanTime
getBanUsername
getUnbanTime
isBan
kickPlayer
setBanAdmin
setBanNick
setBanReason
setUnbanTime
removeBan
reloadBans

playSoundFrontEnd

getGameType
getMapName
getRuleValue
removeRuleValue
setGameType
setMapName
setRuleValue

createBlip
createBlipAttachedTo
getBlipColor
getBlipIcon
getBlipSize
setBlipColor
setBlipIcon
setBlipSize
getBlipOrdering
setBlipOrdering
getBlipVisibleDistance
setBlipVisibleDistance

fadeCamera
getCameraInterior
getCameraMatrix
getCameraTarget
setCameraInterior
setCameraMatrix
setCameraTarget

getBodyPartName
getClothesByTypeIndex
getClothesTypeName
getTypeIndexFromClothes

createColCircle
createColCuboid
createColRectangle
createColSphere
createColTube
createColPolygon
isElementWithinColShape
getElementsWithinColShape
getElementColShape

isCursorShowing
showCursor

clearElementVisibleTo
cloneElement
createElement
destroyElement
getAllElementData
getAttachedElements
getElementAlpha
getElementAttachedOffsets
getElementCollisionsEnabled
getElementAttachedTo
getElementByID
getElementByIndex
getElementChild
getElementChildren
getElementChildrenCount
getElementColShape
getElementData
getElementDimension
getElementHealth
getElementID
getElementInterior
getElementMatrix
getElementParent
getElementPosition
getElementRotation
getElementsByType
getElementsWithinColShape
getElementType
getElementVelocity
getElementZoneName
getRootElement
isElement
isElementAttached
isElementCallPropagationEnabled
isElementDoubleSided
isElementFrozen
isElementVisibleTo
isElementWaitingForGroundToLoad
isElementWithinColShape
removeElementData
setElementAlpha
setElementCallPropagationEnabled
setElementCollisionsEnabled
setElementData
setElementDoubleSided
setElementDimension
setElementFrozen
setElementHealth
setElementID
setElementInterior
setElementParent
setElementPosition
setElementSyncer
setElementRotation
setElementVelocity
setElementVisibleTo
attachElements
detachElements
getElementModel
getElementSyncer
isElementInWater
setElementAttachedOffsets
setElementModel
setLowLODElement
getLowLODElement
isElementLowLOD


addEvent
addEventHandler
getEventHandlers
cancelEvent
getCancelReason
removeEventHandler
triggerClientEvent
triggerEvent
wasEventCancelled
triggerLatentClientEvent
getLatentEventHandles
getLatentEventStatus
cancelLatentEvent


createExplosion

fileClose
fileCopy
fileCreate
fileDelete
fileExists
fileFlush
fileGetPath
fileGetPos
fileGetSize
fileIsEOF
fileOpen
fileRead
fileRename
fileSetPos
fileWrite

httpClear
httpRequestLogin
httpSetResponseCode
httpSetResponseCookie
httpSetResponseHeader
httpWrite

bindKey
getControlState
getFunctionsBoundToKey
getKeyBoundToFunction
isControlEnabled
isKeyBound
setControlState
toggleAllControls
toggleControl
unbindKey


loadMapData
resetMapInfo
saveMapData

createMarker
getMarkerColor
getMarkerCount
getMarkerIcon
getMarkerSize
getMarkerTarget
getMarkerType
isElementWithinMarker
setMarkerColor
setMarkerIcon
setMarkerSize
setMarkerTarget
setMarkerType


Vector/Vector2
Vector/Vector3
Vector/Vector4

getLoadedModules
getModuleInfo

createObject
moveObject
stopObject
getObjectScale
setObjectScale


addPedClothes
createPed
doesPedHaveJetPack
getPedAmmoInClip
getPedArmor
getPedClothes
getPedContactElement
getPedFightingStyle
getPedGravity
getPedOccupiedVehicle
getPedOccupiedVehicleSeat
getPedStat
getPedTarget
getPedTotalAmmo
getPedWalkingStyle
getPedWeapon
getPedWeaponSlot
getValidPedModels
givePedJetPack
isPedChoking
isPedDead
isPedDoingGangDriveby
isPedDucked
isPedFrozen
isPedHeadless
isPedInVehicle
isPedInWater
isPedOnFire
isPedOnGround
killPed
reloadPedWeapon
removePedClothes
removePedFromVehicle
removePedJetPack
setPedAnimation
setPedAnimationProgress
setPedAnalogControlState
setPedArmor
setPedChoking
setPedDoingGangDriveby
setPedFightingStyle
setPedFrozen
setPedGravity
setPedHeadless
setPedOnFire
setPedStat
setPedWeaponSlot
setPedWalkingStyle
warpPedIntoVehicle

createPickup
getPickupAmmo
getPickupAmount
getPickupType
getPickupWeapon
setPickupType
getPickupRespawnInterval
isPickupSpawned
setPickupRespawnInterval
usePickup


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
showPlayerHudComponent
spawnPlayer
takePlayerMoney
takePlayerScreenShot

detonateSatchels


createRadarArea
getRadarAreaColor
getRadarAreaSize
isInsideRadarArea
isRadarAreaFlashing
setRadarAreaColor
setRadarAreaFlashing
setRadarAreaSize

addResourceConfig
addResourceMap
call
callRemote
fetchRemote
copyResource
createResource
getResourceConfig
getResourceDynamicElementRoot
getResourceExportedFunctions
getResourceFromName
getResourceInfo
getResourceLastStartTime
getResourceLoadFailureReason
getResourceLoadTime
getResourceMapRootElement
getResourceName
getResourceRootElement
getResources
getResourceState
getThisResource
refreshResources
removeResourceFile
restartResource
startResource
stopResource
setResourceInfo
renameResource
deleteResource
getResourceACLRequests
updateResourceACLRequest


addCommandHandler
executeCommandHandler
fromJSON
getFPSLimit
getMaxPlayers
getServerHttpPort
getServerName
getServerPassword
getServerPort
getVersion
isGlitchEnabled
outputChatBox
outputConsole
outputDebugString
outputServerLog
removeCommandHandler
setFPSLimit
setGlitchEnabled
setMaxPlayers
setServerPassword
showChat
shutdown
toJSON

get
set

executeSQLQuery
dbConnect
dbExec
dbQuery
dbPoll
dbFree
dbPrepareString


countPlayersInTeam
createTeam
getPlayersInTeam
getPlayerTeam
getTeamColor
getTeamFriendlyFire
getTeamFromName
getTeamName
setPlayerTeam
setTeamColor
setTeamFriendlyFire
setTeamName

textCreateTextItem
textDestroyTextItem
textItemGetColor
textItemGetPosition
textItemGetPriority
textItemGetScale
textItemGetText
textItemSetColor
textItemSetPosition
textItemSetPriority
textItemSetScale
textItemSetText
textCreateDisplay
textDestroyDisplay
textDisplayAddObserver
textDisplayAddText
textDisplayRemoveObserver
textDisplayRemoveText
textDisplayGetObservers
textDisplayIsObserver


getColorFromString
getDistanceBetweenPoints2D
getDistanceBetweenPoints3D
getEasingValue
interpolateBetween
getPerformanceStats
getNetworkStats
getNetworkUsageData
getServerConfigSetting
setServerConfigSetting
getRealTime
getTickCount
getTimerDetails
getTimers
gettok

getUserdataType
hash
killTimer
resetTimer
setTimer
split
isOOPEnabled
isTimer
md5
sha256
teaEncode
teaDecode
base64Encode
base64Decode
utfChar
utfCode
utfLen
utfSeek
utfSub
pregFind
pregReplace
pregMatch
bitAnd
bitNot
bitOr
bitXor
bitTest
bitLRotate
bitRRotate
bitLShift
bitRShift
bitArShift
bitExtract
bitReplace
addDebugHook
removeDebugHook


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


createVehicle
addVehicleSirens
removeVehicleSirens
removeVehicleUpgrade
addVehicleUpgrade
attachTrailerToVehicle
blowVehicle
detachTrailerFromVehicle
fixVehicle
resetVehicleExplosionTime
resetVehicleIdleTime
respawnVehicle
spawnVehicle
toggleVehicleRespawn
isTrainChainEngine
isTrainDerailable
isTrainDerailed
isVehicleBlown
isVehicleTaxiLightOn
isVehicleDamageProof
isVehicleFuelTankExplodable
isVehicleLocked
isVehicleOnGround
getTrainDirection
getTrainSpeed

getTrainTrack
getTrainPosition
getVehicleColor
getVehicleCompatibleUpgrades
getVehicleController
getVehicleDoorState
getVehicleEngineState
getVehicleLandingGearDown
getVehicleLightState
getVehicleMaxPassengers
getVehicleName
getVehicleOccupant
getVehicleOccupants
getVehicleOverrideLights
getVehiclePaintjob
getVehiclePanelState
getVehiclePlateText
getVehicleSirensOn
getVehiclesOfType
getVehicleTowedByVehicle
getVehicleTowingVehicle
getVehicleTurnVelocity
getVehicleTurretPosition
getVehicleType
getVehicleUpgradeOnSlot
getVehicleUpgrades
getVehicleUpgradeSlotName
getVehicleWheelStates
getVehicleDoorOpenRatio
getVehicleHandling
getModelHandling
getOriginalHandling
getVehicleHeadLightColor
getVehicleModelFromName
getVehicleNameFromModel
getVehicleVariant
getVehicleSirenParams
getVehicleSirens
setModelHandling
setTrainDerailable
setTrainDerailed
setTrainDirection
setTrainSpeed

setTrainPosition
setTrainTrack
setVehicleColor
setVehicleDamageProof
setVehicleDoorState
setVehicleDoorsUndamageable
setVehicleEngineState
setVehicleFuelTankExplodable
setVehicleIdleRespawnDelay
setVehicleLandingGearDown
setVehicleLightState
setVehicleLocked
setVehicleOverrideLights
setVehiclePaintjob
setVehiclePanelState
setVehiclePlateText
setVehicleRespawnDelay
setVehicleRespawnPosition
setVehicleSirensOn
setVehicleTurretPosition
setVehicleDoorOpenRatio
setVehicleHandling
setVehicleTurnVelocity
setVehicleWheelStates
setVehicleHeadLightColor
setVehicleTaxiLightOn
setVehicleVariant
setVehicleSirens


createWater
getWaterColor
getWaterVertexPosition
getWaveHeight
resetWaterColor
setWaterColor
setWaterLevel
setWaterVertexPosition
setWaveHeight
resetWaterLevel



getSlotFromWeapon
getWeaponIDFromName
getWeaponNameFromID
giveWeapon
setWeaponAmmo
takeAllWeapons
takeWeapon
getOriginalWeaponProperty
getWeaponProperty
setWeaponProperty


areTrafficLightsLocked
getCloudsEnabled
getGameSpeed
getGravity
getHeatHaze
getJetpackMaxHeight
getMinuteDuration
getSkyGradient
getTime
getTrafficLightState
getWeather
getZoneName
isGarageOpen
resetSkyGradient
resetHeatHaze
setCloudsEnabled
setGameSpeed
setGarageOpen
setGravity
setHeatHaze
setMinuteDuration
setSkyGradient
setTime
setTrafficLightState
setTrafficLightsLocked
setWeather
setWeatherBlended
setInteriorSoundsEnabled
getInteriorSoundsEnabled
setRainLevel
getRainLevel
resetRainLevel
setSunSize
getSunSize
resetSunSize
setSunColor
getSunColor
resetSunColor
setWindVelocity
getWindVelocity
resetWindVelocity
setFarClipDistance
getFarClipDistance
resetFarClipDistance
setFogDistance
getFogDistance
resetFogDistance
removeWorldModel
restoreWorldModel
restoreAllWorldModels
setOcclusionsEnabled
getOcclusionsEnabled
setJetpackWeaponEnabled
getJetpackWeaponEnabled
setAircraftMaxVelocity
getAircraftMaxVelocity
setMoonSize
getMoonSize
resetMoonSize

xmlCopyFile
xmlCreateFile
xmlDestroyNode
xmlLoadFile
xmlNodeGetAttribute
xmlNodeGetValue
xmlNodeSetAttribute
xmlNodeSetValue
xmlSaveFile
xmlUnloadFile
xmlCreateChild
xmlFindChild
xmlNodeGetAttributes
xmlNodeGetChildren
xmlNodeGetName
xmlNodeGetParent
xmlNodeSetName

 

This is a list of server side functions or it could be shared also so some of them also aren't colored and missing also .

Edited by Mr.Pres[T]ege
Add functions
  • Like 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...