iFoReX Posted June 29, 2012 Share Posted June 29, 2012 I have a problem in line 69, near day here the code : GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.32,0.2817,0.3625,0.28,"Ventana de Llamados",true) GUIEditor_Edit[1] = guiCreateEdit(40,69,201,36,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(80,113,115,39,"Llamar !",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.1375,0.14,0.8012,0.775,"Historial de la Llamada",true) GUIEditor_Grid[1] = guiCreateGridList(9,30,483,364,false,GUIEditor_Window[2]) col = guiGridListAddColumn(GUIEditor_Grid[1],"Mensaje",0.2) GUIEditor_Button[2] = guiCreateButton(514,82,61,38,"Enviar !",false,GUIEditor_Window[2]) GUIEditor_Edit[2] = guiCreateEdit(10,403,481,41,"",false,GUIEditor_Window[2]) GUIEditor_Button[3] = guiCreateButton(512,136,61,38,"Cancelar",false,GUIEditor_Window[2]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) showCursor(false) bindKey("L","down",function() guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) guiSetVisible(GUIEditor_Window[2],false) showCursor(guiGetVisible(GUIEditor_Window[1])) end ) function addPlayerNumber(player,numeroID) local elnumeroXML = xmlCreateFile("numero","numero") local elnumeroChild = xmlCreateChild(elnumeroXML, "numeroID") xmlNodeSetAttribute(elnumeroChild, "numeroNode", numeroID) local saveXML = xmlSaveFile(elnumeroXML) if saveXML and player ~= nil then outputChatBox("numero creado correctamente",player) end end function findPlayerNumber(player,numeroE) local elnumeroXML = xmlLoadFile("numero") local childXML = xmlFindChild(elnumeroXML,"numeroID",0) local getNumero = xmlNodeGetAttribute(childXML,numeroE) if getNumero then outputChatBox("numero encontrado con exito",player) end end addCommandHandler("crearnumero",root,function(cmd, numero) if ( numero ) then addPlayerNumber(getLocalPlayer(),numero) end end ) addEventHandler("onClientGUIClick",root,function() if source == GUIEditor_Button[1] then local check = findPlayerNumber(getLocalPlayer(),guiGetText(GUIEditor_Edit[1])) if check ~= nil or check ~= '' then guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) elseif check == nil then outputChatBox("numero no conocido",getLocalPlayer()) end elseif source == GUIEditor_Button[2] then local row = guiGridListAddRow(GUIEditor_Grid[1]) local time = getRealTime() local day = time.weekday local month = time.month local year = time.year guiGridListSetItemText(GUIEditor_Grid[1],row,col,""day.."/"..month.."/"..year..", "..getPlayerName( getLocalPlayer() ).." : "..guiGetText(GUIEditor_Edit[2]).."",false,false) end end ) Link to comment
Tete omar Posted June 29, 2012 Share Posted June 29, 2012 try this GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.32,0.2817,0.3625,0.28,"Ventana de Llamados",true) GUIEditor_Edit[1] = guiCreateEdit(40,69,201,36,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(80,113,115,39,"Llamar !",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.1375,0.14,0.8012,0.775,"Historial de la Llamada",true) GUIEditor_Grid[1] = guiCreateGridList(9,30,483,364,false,GUIEditor_Window[2]) col = guiGridListAddColumn(GUIEditor_Grid[1],"Mensaje",0.2) GUIEditor_Button[2] = guiCreateButton(514,82,61,38,"Enviar !",false,GUIEditor_Window[2]) GUIEditor_Edit[2] = guiCreateEdit(10,403,481,41,"",false,GUIEditor_Window[2]) GUIEditor_Button[3] = guiCreateButton(512,136,61,38,"Cancelar",false,GUIEditor_Window[2]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) showCursor(false) bindKey("L","down",function() guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) guiSetVisible(GUIEditor_Window[2],false) showCursor(guiGetVisible(GUIEditor_Window[1])) end ) function addPlayerNumber(player,numeroID) local elnumeroXML = xmlCreateFile("numero","numero") local elnumeroChild = xmlCreateChild(elnumeroXML, "numeroID") xmlNodeSetAttribute(elnumeroChild, "numeroNode", numeroID) local saveXML = xmlSaveFile(elnumeroXML) if saveXML and player ~= nil then outputChatBox("numero creado correctamente",player) end end function findPlayerNumber(player,numeroE) local elnumeroXML = xmlLoadFile("numero") local childXML = xmlFindChild(elnumeroXML,"numeroID",0) local getNumero = xmlNodeGetAttribute(childXML,numeroE) if getNumero then outputChatBox("numero encontrado con exito",player) end end addCommandHandler("crearnumero", function(cmd, numero) if ( numero ) then addPlayerNumber(getLocalPlayer(),numero) end end ) addEventHandler("onClientGUIClick",root,function() if source == GUIEditor_Button[1] then local check = findPlayerNumber(getLocalPlayer(),guiGetText(GUIEditor_Edit[1])) if check ~= nil or check ~= '' then guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],true) elseif check == nil then outputChatBox("numero no conocido",getLocalPlayer()) end elseif source == GUIEditor_Button[2] then local row = guiGridListAddRow(GUIEditor_Grid[1]) local time = getRealTime() local day = time.weekday local month = time.month local year = time.year guiGridListSetItemText(GUIEditor_Grid[1],row,col,""..day.."/"..month.."/"..year..", "..getPlayerName( getLocalPlayer() ).." : "..guiGetText(GUIEditor_Edit[2]).."",false,false) 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