iFoReX Posted April 18, 2012 Share Posted April 18, 2012 aqui ta mi codigo porfas ayudenme GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(0.3535,0.2417,0.5498,0.605,"GUI Editor De Casas",true) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(18,47,169,18,"Coordinadas donde se entrara",false,GUIEditor_Window[1]) GUIEditor_Edit[1] = guiCreateEdit(17,68,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[1],true) GUIEditor_Edit[2] = guiCreateEdit(17,94,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[2],true) GUIEditor_Edit[3] = guiCreateEdit(17,120,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[3],true) GUIEditor_Label[2] = guiCreateLabel(18,179,228,18,"Coordinadas donde se teletrans. a la casa",false,GUIEditor_Window[1]) GUIEditor_Edit[4] = guiCreateEdit(17,196,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[4],true) GUIEditor_Edit[5] = guiCreateEdit(17,222,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[5],true) GUIEditor_Edit[6] = guiCreateEdit(17,248,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[6],true) GUIEditor_Label[3] = guiCreateLabel(349,47,169,18,"Coordinadas donde se saldra",false,GUIEditor_Window[1]) GUIEditor_Edit[7] = guiCreateEdit(347,68,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[7],true) GUIEditor_Edit[8] = guiCreateEdit(348,94,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[8],true) GUIEditor_Edit[9] = guiCreateEdit(349,120,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[9],true) GUIEditor_Label[4] = guiCreateLabel(308,179,216,19,"Coordinadas donde se saldra al exterior",false,GUIEditor_Window[1]) GUIEditor_Edit[10] = guiCreateEdit(347,197,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[10],true) GUIEditor_Edit[11] = guiCreateEdit(348,223,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[11],true) GUIEditor_Edit[12] = guiCreateEdit(349,248,166,26,"",false,GUIEditor_Window[1]) guiEditSetReadOnly(GUIEditor_Edit[12],true) GUIEditor_Label[5] = guiCreateLabel(203,35,125,16,"GUI Creada By ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255,255,0) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Button[1] = guiCreateButton(18,148,163,27,"Obtener Posicion",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(351,148,163,27,"Obtener Posicion",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(17,274,163,27,"Obtener Posicion",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(351,274,163,27,"Obtener Posicion",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(207,324,110,30,"Crear Casa",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.1523,0.245,0.2021,0.3283,"GUI Extras",true) guiWindowSetMovable(GUIEditor_Window[2],false) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Label[6] = guiCreateLabel(9,41,71,20,"Dimension",false,GUIEditor_Window[2]) GUIEditor_Edit[13] = guiCreateEdit(77,38,119,25,"",false,GUIEditor_Window[2]) GUIEditor_Label[7] = guiCreateLabel(9,76,71,20,"World",false,GUIEditor_Window[2]) GUIEditor_Edit[14] = guiCreateEdit(77,73,119,25,"",false,GUIEditor_Window[2]) GUIEditor_Label[8] = guiCreateLabel(9,112,71,20,"Costo",false,GUIEditor_Window[2]) GUIEditor_Edit[15] = guiCreateEdit(77,106,119,25,"",false,GUIEditor_Window[2]) guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(GUIEditor_Window[2], false) showCursor(false) function obtenerPos(localPlayer) if ( source == GUIEditor_Button[1] ) then x, y, z = getElementPosition(localPlayer) guiSetText( GUIEditor_Edit[1], x ) guiSetText( GUIEditor_Edit[2], y ) guiSetText( GUIEditor_Edit[3], z ) end end addEventHandler ( "onClientClick", getRootElement(), obtenerPos ) function ver ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) guiSetVisible ( GUIEditor_Window[2], not guiGetVisible ( GUIEditor_Window[2] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[2] ) ) end bindKey ( "n","down", ver ) Link to comment
Soren Posted April 18, 2012 Share Posted April 18, 2012 La verdad no se que decirte y si prubas poniendo asi local x, y, z = getElementPsition(player) La verdad no se que decirte Link to comment
Alexs Posted April 18, 2012 Share Posted April 18, 2012 function obtenerPos(localPlayer) if ( source == GUIEditor_Button[1] ) then x, y, z = getElementPosition(localPlayer) guiSetText( GUIEditor_Edit[1], x ) guiSetText( GUIEditor_Edit[2], y ) guiSetText( GUIEditor_Edit[3], z ) end end addEventHandler ( "onClientClick", getRootElement(), obtenerPos ) Donde se define lo de " if ( source == GUIEditor_Button[1] ) then " ?? Edit: lo que dijo Soren podria estar bien, quiza no se define asi la variable, pero soy novato en esto de las variables y recien empiezo con todo esto de LUA Link to comment
iFoReX Posted April 18, 2012 Author Share Posted April 18, 2012 alexs, no entiendo , como es eso de "en donde se define" ]? Link to comment
Alexs Posted April 18, 2012 Share Posted April 18, 2012 alexs, no entiendo , como es eso de "en donde se define" ]? no veo donde esta el source ni que variable es la de "GUIEditor_Button[1]" Link to comment
iFoReX Posted April 18, 2012 Author Share Posted April 18, 2012 la variable esta arriba en la GUI y lo de soren lo probe y no me funciono Link to comment
Alexs Posted April 18, 2012 Share Posted April 18, 2012 function obtenerPos(localPlayer) local x, y, z = getElementPosition(localPlayer) guiSetText( GUIEditor_Edit[1], x ) guiSetText( GUIEditor_Edit[2], y ) guiSetText( GUIEditor_Edit[3], z ) end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], obtenerPos, true ) Intenta asi (no te aseguro nada) Tambien creo que no puedes usar "X" "Y" y "Z" por separado y puedes usar otra variable de jugador como Player o source Link to comment
iFoReX Posted April 18, 2012 Author Share Posted April 18, 2012 funciona pero a medias , en la GUI se escribe x y z no las posiciones porq sera :c Lo arregle ahora funciona a la perfeccion aqui mi codigo addEventHandler( 'onClientGUIClick', root, function( btn ) if btn ~= 'left' then return false; end; if source == GUIEditor_Button[1] then local x, y, z = getElementPosition( me ); guiSetText( GUIEditor_Edit[1], x ); guiSetText( GUIEditor_Edit[2], y ); guiSetText( GUIEditor_Edit[3], z ); end; end ); Link to comment
Alexs Posted April 18, 2012 Share Posted April 18, 2012 funciona pero a medias , en la GUI se escribe x y z no las posiciones porq sera :cLo arregle ahora funciona a la perfeccion aqui mi codigo addEventHandler( 'onClientGUIClick', root, function( btn ) if btn ~= 'left' then return false; end; if source == GUIEditor_Button[1] then local x, y, z = getElementPosition( me ); guiSetText( GUIEditor_Edit[1], x ); guiSetText( GUIEditor_Edit[2], y ); guiSetText( GUIEditor_Edit[3], z ); end; end ); Fui UTIL? OMG! Best Day Ever!! OMG OMG OMG OMG Link to comment
iFoReX Posted April 18, 2012 Author Share Posted April 18, 2012 funciona pero a medias , en la GUI se escribe x y z no las posiciones porq sera :cLo arregle ahora funciona a la perfeccion aqui mi codigo addEventHandler( 'onClientGUIClick', root, function( btn ) if btn ~= 'left' then return false; end; if source == GUIEditor_Button[1] then local x, y, z = getElementPosition( me ); guiSetText( GUIEditor_Edit[1], x ); guiSetText( GUIEditor_Edit[2], y ); guiSetText( GUIEditor_Edit[3], z ); end; end ); Fui UTIL? OMG! Best Day Ever!! OMG OMG OMG OMG Si lo fuiste Link to comment
iFoReX Posted April 18, 2012 Author Share Posted April 18, 2012 Man ahora ... como podria guardar los que compraron esa casa en un xml ? Link to comment
Alexs Posted April 18, 2012 Share Posted April 18, 2012 funciona pero a medias , en la GUI se escribe x y z no las posiciones porq sera :cLo arregle ahora funciona a la perfeccion aqui mi codigo addEventHandler( 'onClientGUIClick', root, function( btn ) if btn ~= 'left' then return false; end; if source == GUIEditor_Button[1] then local x, y, z = getElementPosition( me ); guiSetText( GUIEditor_Edit[1], x ); guiSetText( GUIEditor_Edit[2], y ); guiSetText( GUIEditor_Edit[3], z ); end; end ); Fui UTIL? OMG! Best Day Ever!! OMG OMG OMG OMG Si lo fuiste Repito: OMG OMG OMG OMG OMG OMG OMG Man ahora ... como podria guardar los que compraron esa casa en un xml ? mm.... xmlCreateFile xmlDestroyNode xmlLoadFile xmlNodeGetAttribute xmlNodeGetValue xmlNodeSetAttribute xmlNodeSetValue xmlSaveFile xmlCreateChild xmlFindChild xmlNodeGetAttributes xmlNodeGetChildren xmlNodeGetName xmlNodeSetName Investiga las funciones XML, y te aconsejo el script ese de las casas o algun otro resource que use XML como base de datos, y analisa sus funcionalidades Link to comment
Edikosh998 Posted April 18, 2012 Share Posted April 18, 2012 No te recomiendo un xml para guardar datos. Osea no es un medio para guardar datos de jugadores (por lo menos en mi punto de vista). El xml se usa para datos estaticos, osea que no vas a agregar ni cambiar (ponele ubicaciones, listas,etc...) Te recomiendo que uses o SQL (que bueno es lo mejor, pero es dificil explicarlo. Capaz un poco de paciencia) y sino accountData. https://wiki.multitheftauto.com/wiki/SetAccountData Link to comment
iFoReX Posted April 18, 2012 Author Share Posted April 18, 2012 Ok y ahora no se puede crear el marker elseif source == GUIEditor_Button[5] then marker = createMarker( (tonumber(guiGetText( GUIEditor_Edit[1] )) , "cylinder", 1.7, 0, 170, 0, 90 ) guiGetText( GUIEditor_Edit[11] ); guiGetText( GUIEditor_Edit[12] ); end; end ); Link to comment
Edikosh998 Posted April 18, 2012 Share Posted April 18, 2012 Ahi esta mal el tema del guiGetText...osea puede detectas un numero pero no los 3. Osea para el caso, seguramente deberias hacer guiGetText con cada coordenada. Link to comment
iFoReX Posted April 18, 2012 Author Share Posted April 18, 2012 me dirias como hacer para detectar un numero ya se como aserle , ademas pasando a lo del SQL me explicarias porfa, sigo sin entender el sistema de funcionamiento de SQL ._. Link to comment
Edikosh998 Posted April 18, 2012 Share Posted April 18, 2012 Correccion : elseif source == GUIEditor_Button[5] then marker = createMarker( tonumber(guiGetText( GUIEditor_Edit[1] ),tonumber(guiGetText( GUIEditor_Edit[2] ),tonumber(guiGetText( GUIEditor_Edit[3] ) , "cylinder", 1.7, 0, 170, 0, 90 ) guiGetText( GUIEditor_Edit[11] ); guiGetText( GUIEditor_Edit[12] ); end; end ); El SQL a ver, a mi me costo entenderlo hasta que vi que es un lenguaje donde guardar datos como un Excel. Entonces como dice el nombre (Structured Query Language), vos vas pidiendo a traves de consultas, el agregar o quitar datos. Empezemos MUY PERO MUY BASICO, sino no sirve. Quiero crear una tabla entonces el SQL pide : funcion crearTabla() executeSQLQuery("CREATE TABLE IF NOT EXISTS nombreDeTabla (ColumnaUno NUMBER,ColumnaDos STRING)") --Entonces la sintaxis es : CREATE TABLE IF NOT EXISTS [tabla] ([columna] [tipoDeColumna]) -- Tipo de columna es que datos queres que guarde, o cadena de texto o numero. -- Columna es lo que aparece como A,B,C en el Excel y filas la parte horizontal end addEventHandler("onResourceStart",root,crearTabla) Mira eso es una parte, quiero saber si entendistes...porque tampoco es facil enseniar estos tipos de lenguajes. Link to comment
Alexs Posted April 18, 2012 Share Posted April 18, 2012 creo que esta fuera de topico, pero el archivo internal.db se presta para consultas PHP? Link to comment
Edikosh998 Posted April 18, 2012 Share Posted April 18, 2012 No se que es internal.db , lo veo como un archivo de base de datos... El PHP al parecer funciona para funciones de SQL, pero es un lenguaje que no me interesa aprender sinceramente. Estoy mas enganchado con C# ahora. Esto es : http://en.wikipedia.org/wiki/Windows_Internal_Database ? Link to comment
iFoReX Posted April 18, 2012 Author Share Posted April 18, 2012 Gracias man voy entendiendo , lo de la correcion ai un ) malo Link to comment
Edikosh998 Posted April 18, 2012 Share Posted April 18, 2012 Gracias man voy entendiendo , lo de la correcion ai un ) malo Varios mal habia, eso porque me apuro sory elseif source == GUIEditor_Button[5] then marker = createMarker( tonumber(guiGetText( GUIEditor_Edit[1] )),tonumber(guiGetText( GUIEditor_Edit[2] )),tonumber(guiGetText( GUIEditor_Edit[3] )) , "cylinder", 1.7, 0, 170, 0, 90 ) guiGetText( GUIEditor_Edit[11] ); guiGetText( GUIEditor_Edit[12] ); end; end ); Link to comment
iFoReX Posted April 19, 2012 Author Share Posted April 19, 2012 que esta mal ? la ventana no aparese :c function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then GUIEditor_Window[1] = guiCreateWindow(0.6006,0.4867,0.1992,0.45,"GUI Casas",true) GUIEditor_Label[1] = guiCreateLabel(25,36,262,20,"Dueño de la casa : \"\"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(25,58,231,19,"Precio : \"\"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,107,179,30,"Comprar Casa",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,107,179,30,"Comprar Casa",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,141,179,30,"Vender Casa",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,175,179,30,"Bloquear Casa",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(10,208,179,32,"Entrar a la Casa",false,GUIEditor_Window[1]) end end addEventHandler ("onClientMarkerHit", marker, markerHit) Link to comment
Soren Posted April 19, 2012 Share Posted April 19, 2012 function markerHit (hitPlayer) if ( hitPlayer ~= localPlayer ) then GUIEditor_Window[1] = guiCreateWindow(0.6006,0.4867,0.1992,0.45,"GUI Casas",true) GUIEditor_Label[1] = guiCreateLabel(25,36,262,20,"Dueño de la casa : \"\"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(25,58,231,19,"Precio : \"\"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,107,179,30,"Comprar Casa",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,107,179,30,"Comprar Casa",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,141,179,30,"Vender Casa",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,175,179,30,"Bloquear Casa",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(10,208,179,32,"Entrar a la Casa",false,GUIEditor_Window[1]) end end addEventHandler ("onClientMarkerHit", maker, markerHit) Recuerden que no es lo msimo el == que el ~= la verdad no se si ete bien Link to comment
Castillo Posted April 19, 2012 Share Posted April 19, 2012 function markerHit ( hitPlayer ) if ( hitPlayer == localPlayer ) then GUIEditor_Window[1] = guiCreateWindow(0.6006,0.4867,0.1992,0.45,"GUI Casas",true) GUIEditor_Label[1] = guiCreateLabel(25,36,262,20,"Dueño de la casa : \"\"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(25,58,231,19,"Precio : \"\"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(9,107,179,30,"Comprar Casa",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,107,179,30,"Comprar Casa",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,141,179,30,"Vender Casa",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,175,179,30,"Bloquear Casa",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(10,208,179,32,"Entrar a la Casa",false,GUIEditor_Window[1]) end end addEventHandler ( "onClientMarkerHit", maker, markerHit ) "==" es: Igual a. "~=" es: Diferente a. Link to comment
iFoReX Posted April 19, 2012 Author Share Posted April 19, 2012 No funciona Solid aqui una IMG Link to comment
Recommended Posts