guiMemoIsReadOnly | Multi Theft Auto: Wiki Skip to content

guiMemoIsReadOnly

Client-side
Server-side
Shared

Pair: guiMemoSetReadOnly

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function checking if memo is read only or no.

OOP Syntax Help! I don't understand this!

  • Method: guimemo:isReadOnly(...)
  • Variable: .readOnly

Syntax

bool guiMemoIsReadOnly ( gui-memo theMemo )
Required Arguments
  • theMemo: The memo to check read-only status of.

Returns

  • bool: value

Returns true if the memo is read only, false if the memo isn't read only, nil otherwise.

Code Examples

shared
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), -- only execute the code when this resource restarts
function( )
memo = guiCreateMemo( 0.4, 0.4, 0.2, 0.2, "This is a memo.", true ) -- create a relative memo GUI element
guiMemoSetReadOnly( memo, true ) -- make it read only, so players won't be able to edit it in-game
addCommandHandler("isReadOnly",function() -- add a command 'isReadOnly'
local isReadOnly = guiMemoIsReadOnly(memo)
outputChatBox("Memo read only: "..isReadOnly) -- show info about memo
end)
end
)

See Also

GUI Functions