xTeacherx Posted May 1, 2012 Share Posted May 1, 2012 Hi all This Cods @ window = guiCreateWindow(202,192,655,432,"news",false) showCursor (true) butto = guiCreateButton(0.8336,0.7662,0.142,0.1366,"Edit",true,window) editBo = guiCreateMemo(0.0229,0.0579,0.8015,0.9097,"",true,window) Close = guiCreateButton(0.8336,0.088,0.142,0.1366,"Close",true,window) -------------------------------------------------------------------------- windows = guiCreateWindow(202,192,655,432," Edit news",false) guiSetVisible ( windows, false ) button = guiCreateButton(0.8336,0.7662,0.142,0.1366,"Edit",true,windows) editBox = guiCreateMemo(0.0229,0.0579,0.8015,0.9097,"",true,windows) Closes = guiCreateButton(0.8336,0.088,0.142,0.1366,"Close",true,windows) guiEditSetMaxLength ( editBox, 128 ) ---------------------------------------------------- function eta() if (source == butto) then guiSetVisible ( windows, true ) end end addEventHandler("onClientGUIClick",butto,eta,false) function closeInfo ( ) if ( guiGetVisible ( windows ) == true ) then guiSetVisible ( windows, false ) showCursor (false) end end addEventHandler ("onClientGUIClick", Closes, closeInfo) function closeInfo ( ) if ( guiGetVisible ( window ) == true ) then guiSetVisible ( window, false ) showCursor (false) end end addEventHandler ("onClientGUIClick", Close, closeInfo) function info(text) if source == button then local text = guiGetText ( editBox ) if text and text ~= "eeee" then guiSetText(editBo,""..text.."",editBox) end end end addEventHandler ( "onClientGUIClick", button, info ) ------------------------------------------------------------------------- Link to comment
Smart. Posted May 1, 2012 Share Posted May 1, 2012 That is one messy code.. anyhow /debugscript 3 and please, might tell us what's wrong / not working? anyhow.. try: editBox = guiCreateEdit(0.0229,0.0579,0.8015,0.9097,"",true,windows) instead of: editBox = guiCreateMemo(0.0229,0.0579,0.8015,0.9097,"",true,windows) Link to comment
Michael# Posted May 1, 2012 Share Posted May 1, 2012 (edited) Totally messed code. eWindow = guiCreateWindow(202,192,655,432,"news",false) eEdit = guiCreateButton(0.8336,0.7662,0.142,0.1366,"Edit",true,window) eBox = guiCreateMemo(0.0229,0.0579,0.8015,0.9097,"",true,window) eClose = guiCreateButton(0.8336,0.088,0.142,0.1366,"Close",true,window) showCursor ( true ) -- eNews = guiCreateWindow(202,192,655,432," Edit news",false) eNEdit = guiCreateButton(0.8336,0.7662,0.142,0.1366,"Edit",true,windows) eNBox = guiCreateMemo(0.0229,0.0579,0.8015,0.9097,"",true,windows) eNClose = guiCreateButton(0.8336,0.088,0.142,0.1366,"Close",true,windows) guiSetVisible ( eNews, false ) guiEditSetMaxLength ( eNBox, 128 ) -- addEventHandler ( 'onClientResourceStart', resourceRoot, function ( ) addEventHandler ( 'onClientGUIClick', root, showGUI ) end ) -- function showGUI ( ) if ( source == eEdit ) then guiSetVisible ( eNews, true ) elseif ( source == eNClose ) then guiGetVisible ( eNews ) and showCursor ( false ) and guiSetVisible ( eNews, false ) elseif ( source == eClose ) then guiSetVisible ( eWindow, false ) showCursor ( false ) elseif ( source == eNEdit ) then local cText = guiGetText ( eNBox ) if ( cText and cText ~= 'eeee' ) then guiSetText ( eBox, cText ) end end ) Edited May 1, 2012 by Guest Link to comment
Smart. Posted May 1, 2012 Share Posted May 1, 2012 @Jayz either am I blind or so have you forgotten to change guiEditSetMaxLength ( editBox, 128 ) Line: 17 Link to comment
Michael# Posted May 1, 2012 Share Posted May 1, 2012 Oh yeah, I noticed this but I forgot to change 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