Tete omar Posted June 4, 2012 Share Posted June 4, 2012 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. Link to comment
Al3grab Posted June 4, 2012 Share Posted June 4, 2012 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 Link to comment
Tete omar Posted June 4, 2012 Author Share Posted June 4, 2012 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 Link to comment
Callum Posted June 4, 2012 Share Posted June 4, 2012 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. Link to comment
X-SHADOW Posted June 4, 2012 Share Posted June 4, 2012 ---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) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now