Jump to content

setMemoReadOnly HELP


Recommended Posts

Posted

If i want to create a memo in a window and set it read only for the players and moderators not for admins and head admins

how ? thank you.

Posted

triggering to server and checking using "hasObjectPermissionTo" or "isObjectInACLGroup" then triggering back to client , or set an element data for the player on login , and checking on memo creation

Posted
triggering to server and checking using "hasObjectPermissionTo" or "isObjectInACLGroup" then triggering back to client , or set an element data for the player on login , and checking on memo creation

Here's

function new() 
if ( source == GUIEditor_Button[1] ) then 
GUIEditor_Window[2] = guiCreateWindow(337,492,346,160,"القوانين",false) 
guiWindowSetMovable(GUIEditor_Window[2],false) 
guiWindowSetSizable(GUIEditor_Window[2],false) 
GUIEditor_Memo[3] = guiCreateMemo(9,23,328,128,"Here admins-HeadAdmins type only",false,GUIEditor_Window[2]) 
      end 
   end 

Posted

Why do you need an example? If we've told you the requirements, but you can't be bothered to do some research on certain fuctions via the MTA Wiki, then scripting may not be for you.

Posted
---ClientSide 
function new() 
if ( source == GUIEditor_Button[1] ) then 
GUIEditor_Window[2] = guiCreateWindow(337,492,346,160,"القوانين",false) 
guiWindowSetMovable(GUIEditor_Window[2],false) 
guiWindowSetSizable(GUIEditor_Window[2],false) 
GUIEditor_Memo[3] = guiCreateMemo(9,23,328,128,"Here admins-HeadAdmins type only",false,GUIEditor_Window[2]) 
      end 
   end 
  
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
if ( source == GUIEditor_Memo[3] ) then 
triggerServerEvent('onAdmin',getLocalPlayer() ) 
end 
end) 
  
addEvent('onAdminFound', true) 
addEventHandler('onAdminFound', root, 
function() 
guiMemoSetReadOnly(GUIEditor_Memo[3], false) 
end) 
  
  
---serverSide 
addEvent('onAdmin', true) 
addEventHandler('onAdmin', root, 
function() 
local me = getAccountName( getPlayerAccount( source ) ) 
if isObjectInACLGroup('user'..me, aclGetGroup ('Admin')) then 
triggerClientEvent(source, 'onAdminFound', source ) 
end 
end) 

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...