iFoReX Posted April 28, 2012 Share Posted April 28, 2012 @tittle why my message appear two times ? I want if the player has wrote in the edit set The text the memo and if he write after the text appear down of the anterior here the .lua GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.3375,0.1983,0.5013,0.655,"GUI PM",true) guiWindowSetSizable(GUIEditor_Window[1],false) guiWindowSetMovable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(11,46,96,28,"",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(9,57,383,281,"",false,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Edit[1] = guiCreateEdit(10,344,288,36,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(302,346,85,37,"Enviar",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(36,27,335,32,"PM A : ",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Window[2] = guiCreateWindow(0.1663,0.1983,0.1737,0.6533,"GUI Players",true) GUIEditor_Grid[1] = guiCreateGridList(10,28,122,375,false,GUIEditor_Window[2]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.6) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) bindKey ( "F7", "down", function ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) guiSetVisible ( GUIEditor_Window[2], not guiGetVisible ( GUIEditor_Window[2] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end ) function clientsideResourceStart () guiGridListClear(GUIEditor_Grid[1]) if (guiGridListClear) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", getRootElement(), clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", getRootElement(), clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", getRootElement(), clientsideResourceStart ) addEventHandler("onClientGUIDoubleClick", root, function() if ( source == GUIEditor_Grid[1] ) then row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) guiSetText(GUIEditor_Label[2], "PM a : "..playername) local thePlayer = getPlayerFromName ( playername ) end end end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] then local getText = guiGetText(GUIEditor_Edit[1]) local getName = getPlayerName( localPlayer ) setText = guiSetText(GUIEditor_Memo[1], ""..getName.." : "..getText.."") if (setText) then getTexts = guiGetText(GUIEditor_Memo[1]) guiSetText(GUIEditor_Memo[1], ""..getTexts.."\n\ "..getName.." : "..getText.."") end end end ) ? Link to comment
Xeno Posted April 28, 2012 Share Posted April 28, 2012 addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[1] then local getText = guiGetText(GUIEditor_Edit[1]) local getName = getPlayerName( localPlayer ) setText = guiSetText(GUIEditor_Memo[1], ""..getName.." : "..getText.."") if (setText) then getTexts = guiGetText(GUIEditor_Memo[1]) guiSetText(GUIEditor_Memo[1], ""..getTexts.."\n\ "..getName.." : "..getText.."") end end end Your using two guiSetText 's Link to comment
iFoReX Posted April 28, 2012 Author Share Posted April 28, 2012 yeah , why I dont want When the player write again the Text change I want when the player write again appear a new text down of the first Link to comment
Xeno Posted April 28, 2012 Share Posted April 28, 2012 Ooh right, sorry I THINK I misunderstood your problem. 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