isOOPEnabled
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function checks whether OOP (Object Oriented Programming) is enabled in the current resource or not.
Syntax
bool isOOPEnabled ( )Returns
- bool: value
Returns true or false if OOP is enabled or not. Returns nil if an error arised.
Code Examples
shared
local function checkOOPStatus() if isOOPEnabled() then outputChatBox("* OOP is enabled! Welcome to matrices' paradise.", getRandomPlayer and root or 0, getRandomPlayer and 0 or 255, getRandomPlayer and 255 or 0, getRandomPlayer and 0 or nil) local player if getRandomPlayer then -- Are we executed serverside? player = Player.getRandom() -- Make it easy, use OOP to get a random player else local players = getElementsByType("player") if #players > 0 then -- Is the server empty? player = players[math.random(1, #players)] -- Get a random player using player elements table end end if not player then return -- We don't have a player. Cancel further execution of this function. end player.position = player.position + player.matrix.left * 10 -- Move him 10 units left, taking into account rotation outputChatBox(player.name .. " was moved 10 meters left as a demostration of OOP capabilities!", getRandomPlayer and root or 180, 180, getRandomPlayer and 180 or 255, getRandomPlayer and 255 or nil) else outputChatBox("* OOP is disabled! You should like the good ol' tables.", getRandomPlayer and root or 255, getRandomPlayer and 255 or 140, getRandomPlayer and 140 or 0, getRandomPlayer and 0 or nil) endendcheckOOPStatus() -- Execute this at resource startSee Also
Utility Functions
- addDebugHook
- bitAnd
- bitArShift
- bitExtract
- bitLRotate
- bitLShift
- bitNot
- bitOr
- bitReplace
- bitRRotate
- bitRShift
- bitTest
- bitXor
- createTrayNotification
- debugSleep
- decodeString
- deref
- downloadFile
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getFPSLimit
- getKeyboardLayout
- getLocalization
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getProcessMemoryStats
- getRealTime
- getServerIp
- getTickCount
- getTimerDetails
- getTimers
- gettok
- getUserdataType
- getVersion
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isShowCollisionsEnabled
- isShowSoundEnabled
- isTimer
- isTimerPaused
- isTransferBoxAlwaysVisible
- isTransferBoxVisible
- isTrayNotificationEnabled
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- ref
- removeDebugHook
- resetTimer
- setClipboard
- setDevelopmentMode
- setFPSLimit
- setTimer
- setTimerPaused
- setTransferBoxVisible
- setWindowFlashing
- sha256
- showCol
- showSound
- split
- teaDecode
- teaEncode
- tocolor
- toJSON
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub