xTeacherx Posted April 29, 2012 Share Posted April 29, 2012 hi all this is cod function mta () window = guiCreateWindow(223,43,629,714,"news",false) guiSetAlpha(window,0.6) editBox = guiCreateMemo(0.0207,0.5392,0.965,0.3754,"",true,window) button = guiCreateButton(0.027,0.9202,0.4563,0.0672,"Edit",true,window) g = guiCreateButton(0.3943,0.2115,0.1558,0.0994,"",true,window) vv1 = guiCreateLabel(0.0318,0.5196,0.9412,0.021,"×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××",true,window) guiLabelSetColor(vv1,255,0,0) Close = guiCreateButton(0.5437,0.9202,0.4372,0.0672,"Clear",true,window) addEventHandler ( "onClientGUIClick", editBox, outputEditBox ) guiEditSetMaxLength ( editBox, 128 ) end addCommandHandler("edit", mta) -------------------------------------------------------------------------- function closeInfo ( ) if ( guiGetVisible ( window ) == true ) then guiSetVisible ( window, false ) end end addEventHandler ("onClientGUIClick", Close, closeInfo) function outputEditBox () local text = guiGetText ( editBox ) editBo = guiCreateMemo(0.0223,0.0322,0.9603,0.493,""..text.."",true,window) end addEventHandler ( "onClientGUIClick", button, outputEditBox ) now i dont have any problem but i wanna ( button = guiCreateButton) true for admini and false for any one Link to comment
KenXeiko Posted April 29, 2012 Share Posted April 29, 2012 My idea is to set data to the player when player login. Well, good luck. setElementData getElementData guiSetEnabled onPlayerLogin Link to comment
iFoReX Posted April 29, 2012 Share Posted April 29, 2012 is more easy it ? function mta () window = guiCreateWindow(223,43,629,714,"news",false) guiSetAlpha(window,0.6) editBox = guiCreateMemo(0.0207,0.5392,0.965,0.3754,"",true,window) button = guiCreateButton(0.027,0.9202,0.4563,0.0672,"Edit",true,window) g = guiCreateButton(0.3943,0.2115,0.1558,0.0994,"",true,window) vv1 = guiCreateLabel(0.0318,0.5196,0.9412,0.021,"×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××",true,window) guiLabelSetColor(vv1,255,0,0) Close = guiCreateButton(0.5437,0.9202,0.4372,0.0672,"Clear",true,window) addEventHandler ( "onClientGUIClick", editBox, outputEditBox ) ---I dont undestand it ? a onClientGUIClick in an function ? guiEditSetMaxLength ( editBox, 128 ) end addCommandHandler("edit", mta) -------------------------------------------------------------------------- function closeInfo ( ) guiSetVisible(window,false) showCursor(false) end addEventHandler ("onClientGUIClick", Close, closeInfo) function outputEditBox () local text = guiGetText ( editBox ) if source == button then editBo = guiCreateMemo(0.0223,0.0322,0.9603,0.493,"",true,window) guiSetText(editBo, "..text..") ---Is more easy set a text end end addEventHandler ( "onClientGUIClick", root, outputEditBox ) Link to comment
Castillo Posted April 29, 2012 Share Posted April 29, 2012 @ElMota: What has that to do with his problem? Link to comment
KenXeiko Posted April 29, 2012 Share Posted April 29, 2012 @ElMota: From what I see, xTeacherx just want to enable Edit button for Admin, and disable it from others. And on your codes, yes, it's actually possible to pur addEventHandler on an function. 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