iFoReX Posted April 5, 2012 Share Posted April 5, 2012 buee quiero hacer el modelo de un sistema de autos pero el guiSetVisible no me funciona :c GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(11,92,229,464,"Mi panel de Spawn",false) GUIEditor_Button[1] = guiCreateButton(9,29,209,43,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,75,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,118,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,162,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(9,251,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(9,206,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(10,296,206,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(10,340,206,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(12,396,205,56,"GUI Creada por ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Window[2] = guiCreateWindow(11,340,219,216,"GUI Shop Panel",false) GUIEditor_Button[9] = guiCreateButton(18,70,168,32,"Comprar Vehiculo",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(18,109,168,32,"Vender Vehiculo",false,GUIEditor_Window[2]) GUIEditor_Button[11] = guiCreateButton(21,148,109,30,"Elejir un Color",false,GUIEditor_Window[2]) GUIEditor_Button[12] = guiCreateButton(22,26,75,39,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(544,249,240,326,"Vehiculos",false) GUIEditor_Grid[1] = guiCreateGridList(9,24,222,293,false,GUIEditor_Window[3]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) guiGridListAddColumn(GUIEditor_Grid[1],"Precio $",0.2) local cars = {{493,699999},{484,300000},{446,1599999},{469,2999999},{563,5999999},{488,6999999},{487,6999999},{417,3999999},{548,4999999},{497,7999999},{579,60000},{400,60000},{404,28000},{489,65000},{505,65000},{479,45000},{442,45000},{458,45000},{602,50000},{496,42500},{401,41000},{518,60000},{527,75000},{589,75000},{419,45000},{533,75000},{526,50000},{474,55000},{545,50000},{517,45000},{410,41000},{600,50000},{436,41000},{580,50000},{439,75000},{549,75000},{491,45000},{445,45000},{507,45000},{585,45000},{587,75000},{466,55000},{492,50000},{546,45000},{551,45000},{516,45000},{467,45000},{426,47500},{547,45000},{405,55000},{409,75000},{550,45000},{566,45000},{540,45000},{421,50000},{529,45000},{402,12000},{542,65000},{603,12000},{475,75000},{562,120000},{565,95000},{559,120000},{561,50000},{560,120000},{558,100000},{429,120000},{541,120000},{415,120000},{480,95000},{434,100000},{494,120000},{502,120000},{503,120000},{411,120000},{506,120000},{451,120000},{555,95000},{477,95000},{499,25000},{498,25000},{578,50000},{486,70000},{455,75000},{588,50000},{403,75000},{414,50000},{443,75000},{515,75000},{514,75000},{531,12000},{456,45000},{422,45000},{482,95000},{530,12000},{418,45000},{572,12000},{582,50000},{413,5000},{440,50000},{543,65000},{583,12000},{478,35000},{554,50000},{536,75000},{575,75000},{534,75000},{567,75000},{535,75000},{576,75000},{412,75000},{568,75000},{457,12000},{483,45000},{508,40000},{571,10000},{500,55000},{444,120000},{556,120000},{557,120000},{471,20000},{495,100000},{539,75000},{481,25050},{509,2500},{581,45000},{462,12000},{521,60000},{463,50000},{522,75000},{448,12000},{468,45000},{586,45000},{485,12000},{431,60000},{438,45000},{437,60000},{574,12000},{420,45000},{525,75000},{408,50000},{428,65000}} for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, carName, false, true) guiGridListSetItemText (GUIEditor_Grid[1], row, 2, tostring(v[2]), false, true) end GUIEditor_Window[4] = guiCreateWindow(252,171,410,105,"Verificacion",false) GUIEditor_Label[2] = guiCreateLabel(10,29,391,25,"Porfavor elije aqui un slot para tu vehiculo",false,GUIEditor_Window[4]) guiLabelSetColor(GUIEditor_Label[2],255,255,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(242,57,43,25,"",false,GUIEditor_Window[4]) guiEditSetMaxLength(GUIEditor_Edit[1],1) GUIEditor_Button[13] = guiCreateButton(10,59,100,37,"Acepto",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(112,65,100,31,"Cancelar",false,GUIEditor_Window[4]) guiSetVisible("GUIEditor_Window[1]", false) guiSetVisible("GUIEditor_Window[2]", false) guiSetVisible("GUIEditor_Window[3]", false) guiSetVisible("GUIEditor_Window[4]", false) showCursor(false) function VerLaGUI() guiSetVisible( "GUIEditor_Window[1]", true ) showCursor(true) end bindKey("F2", "down", VerLaGUI) Porfas ayudenme Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 Por que le pones comillas al guiSetVisible("GUIEditor_Window[1]", false) guiSetVisible("GUIEditor_Window[2]", false) guiSetVisible("GUIEditor_Window[3]", false) guiSetVisible("GUIEditor_Window[4]", false) --? no Deberia ser guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) guiSetVisible(GUIEditor_Window[4], false) Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 listo man grax ahora me ayudarian con esto : quiero aser un camera matrix pero no entiendo mucho como aserlo quien me ayudaria a aserlo please GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(11,92,229,464,"Mi panel de Spawn",false) GUIEditor_Button[1] = guiCreateButton(9,29,209,43,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,75,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,118,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,162,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(9,251,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(9,206,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(10,296,206,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(10,340,206,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(12,396,205,56,"GUI Creada por ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Window[2] = guiCreateWindow(11,340,219,216,"GUI Shop Panel",false) GUIEditor_Button[9] = guiCreateButton(18,70,168,32,"Comprar Vehiculo",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(18,109,168,32,"Vender Vehiculo",false,GUIEditor_Window[2]) GUIEditor_Button[11] = guiCreateButton(21,148,109,30,"Elejir un Color",false,GUIEditor_Window[2]) GUIEditor_Button[12] = guiCreateButton(22,26,75,39,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(544,249,240,326,"Vehiculos",false) GUIEditor_Grid[1] = guiCreateGridList(9,24,222,293,false,GUIEditor_Window[3]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) guiGridListAddColumn(GUIEditor_Grid[1],"Precio $",0.2) local cars = {{493,699999},{484,300000},{446,1599999},{469,2999999},{563,5999999},{488,6999999},{487,6999999},{417,3999999},{548,4999999},{497,7999999},{579,60000},{400,60000},{404,28000},{489,65000},{505,65000},{479,45000},{442,45000},{458,45000},{602,50000},{496,42500},{401,41000},{518,60000},{527,75000},{589,75000},{419,45000},{533,75000},{526,50000},{474,55000},{545,50000},{517,45000},{410,41000},{600,50000},{436,41000},{580,50000},{439,75000},{549,75000},{491,45000},{445,45000},{507,45000},{585,45000},{587,75000},{466,55000},{492,50000},{546,45000},{551,45000},{516,45000},{467,45000},{426,47500},{547,45000},{405,55000},{409,75000},{550,45000},{566,45000},{540,45000},{421,50000},{529,45000},{402,12000},{542,65000},{603,12000},{475,75000},{562,120000},{565,95000},{559,120000},{561,50000},{560,120000},{558,100000},{429,120000},{541,120000},{415,120000},{480,95000},{434,100000},{494,120000},{502,120000},{503,120000},{411,120000},{506,120000},{451,120000},{555,95000},{477,95000},{499,25000},{498,25000},{578,50000},{486,70000},{455,75000},{588,50000},{403,75000},{414,50000},{443,75000},{515,75000},{514,75000},{531,12000},{456,45000},{422,45000},{482,95000},{530,12000},{418,45000},{572,12000},{582,50000},{413,5000},{440,50000},{543,65000},{583,12000},{478,35000},{554,50000},{536,75000},{575,75000},{534,75000},{567,75000},{535,75000},{576,75000},{412,75000},{568,75000},{457,12000},{483,45000},{508,40000},{571,10000},{500,55000},{444,120000},{556,120000},{557,120000},{471,20000},{495,100000},{539,75000},{481,25050},{509,2500},{581,45000},{462,12000},{521,60000},{463,50000},{522,75000},{448,12000},{468,45000},{586,45000},{485,12000},{431,60000},{438,45000},{437,60000},{574,12000},{420,45000},{525,75000},{408,50000},{428,65000}} for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, carName, false, true) guiGridListSetItemText (GUIEditor_Grid[1], row, 2, tostring(v[2]), false, true) end GUIEditor_Window[4] = guiCreateWindow(252,171,410,105,"Verificacion",false) GUIEditor_Label[2] = guiCreateLabel(10,29,391,25,"Porfavor elije aqui un slot para tu vehiculo",false,GUIEditor_Window[4]) guiLabelSetColor(GUIEditor_Label[2],255,255,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(242,57,43,25,"",false,GUIEditor_Window[4]) guiEditSetMaxLength(GUIEditor_Edit[1],1) GUIEditor_Button[13] = guiCreateButton(10,59,100,37,"Acepto",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(112,65,100,31,"Cancelar",false,GUIEditor_Window[4]) guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) guiSetVisible(GUIEditor_Window[4], false) showCursor(false) function VerLaGUI() guiSetVisible( "GUIEditor_Window[1]", true ) showCursor(true) end bindKey("F2", "down", VerLaGUI) ----------------------------------------------------- --Los Markers---- local marker = createMarker(2131.91846, -1149.65430, 23.4, "cylinder", 1.5, 255, 0, 0 ) ----------------------------------------------------- ----------------------------------------------------- --LasFunciones---- function VerLaGUI() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end bindKey("F2", "down", VerLaGUI) addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor_Button[12] ) then guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) showCursor(false) end end ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[2], true) guiSetVisible (GUIEditor_Window[3], true) showCursor (true) end end addEventHandler ("onClientMarkerHit", marker, markerHit) Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 No entiendo a que te referis con la camera Matrix, osea donde queres hacerlo y cuando? Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 algo asi no me sirve eso si esto porque ya no me aparece el marker ._. pero no creo que este tan malo me lo podrias arreglar porfa server-side function camara( hitPlayer ) if ( hitPlayer == localPlayer ) then setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) fadeCamera(source, true, 5) end end addEvent("lacamara", true) addEventHandler("lacamara", root, camara) client-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(11,92,229,464,"Mi panel de Spawn",false) GUIEditor_Button[1] = guiCreateButton(9,29,209,43,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,75,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,118,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,162,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(9,251,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(9,206,208,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(10,296,206,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(10,340,206,41,"Spawnear Vehiculo",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(12,396,205,56,"GUI Creada por ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Window[2] = guiCreateWindow(11,340,219,216,"GUI Shop Panel",false) GUIEditor_Button[9] = guiCreateButton(18,70,168,32,"Comprar Vehiculo",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(18,109,168,32,"Vender Vehiculo",false,GUIEditor_Window[2]) GUIEditor_Button[11] = guiCreateButton(21,148,109,30,"Elejir un Color",false,GUIEditor_Window[2]) GUIEditor_Button[12] = guiCreateButton(22,26,75,39,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(544,249,240,326,"Vehiculos",false) GUIEditor_Grid[1] = guiCreateGridList(9,24,222,293,false,GUIEditor_Window[3]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) guiGridListAddColumn(GUIEditor_Grid[1],"Precio $",0.2) local cars = {{493,699999},{484,300000},{446,1599999},{469,2999999},{563,5999999},{488,6999999},{487,6999999},{417,3999999},{548,4999999},{497,7999999},{579,60000},{400,60000},{404,28000},{489,65000},{505,65000},{479,45000},{442,45000},{458,45000},{602,50000},{496,42500},{401,41000},{518,60000},{527,75000},{589,75000},{419,45000},{533,75000},{526,50000},{474,55000},{545,50000},{517,45000},{410,41000},{600,50000},{436,41000},{580,50000},{439,75000},{549,75000},{491,45000},{445,45000},{507,45000},{585,45000},{587,75000},{466,55000},{492,50000},{546,45000},{551,45000},{516,45000},{467,45000},{426,47500},{547,45000},{405,55000},{409,75000},{550,45000},{566,45000},{540,45000},{421,50000},{529,45000},{402,12000},{542,65000},{603,12000},{475,75000},{562,120000},{565,95000},{559,120000},{561,50000},{560,120000},{558,100000},{429,120000},{541,120000},{415,120000},{480,95000},{434,100000},{494,120000},{502,120000},{503,120000},{411,120000},{506,120000},{451,120000},{555,95000},{477,95000},{499,25000},{498,25000},{578,50000},{486,70000},{455,75000},{588,50000},{403,75000},{414,50000},{443,75000},{515,75000},{514,75000},{531,12000},{456,45000},{422,45000},{482,95000},{530,12000},{418,45000},{572,12000},{582,50000},{413,5000},{440,50000},{543,65000},{583,12000},{478,35000},{554,50000},{536,75000},{575,75000},{534,75000},{567,75000},{535,75000},{576,75000},{412,75000},{568,75000},{457,12000},{483,45000},{508,40000},{571,10000},{500,55000},{444,120000},{556,120000},{557,120000},{471,20000},{495,100000},{539,75000},{481,25050},{509,2500},{581,45000},{462,12000},{521,60000},{463,50000},{522,75000},{448,12000},{468,45000},{586,45000},{485,12000},{431,60000},{438,45000},{437,60000},{574,12000},{420,45000},{525,75000},{408,50000},{428,65000}} for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, carName, false, true) guiGridListSetItemText (GUIEditor_Grid[1], row, 2, tostring(v[2]), false, true) end GUIEditor_Window[4] = guiCreateWindow(252,171,410,105,"Verificacion",false) GUIEditor_Label[2] = guiCreateLabel(10,29,391,25,"Porfavor elije aqui un slot para tu vehiculo",false,GUIEditor_Window[4]) guiLabelSetColor(GUIEditor_Label[2],255,255,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(242,57,43,25,"",false,GUIEditor_Window[4]) guiEditSetMaxLength(GUIEditor_Edit[1],1) GUIEditor_Button[13] = guiCreateButton(10,59,100,37,"Acepto",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(112,65,100,31,"Cancelar",false,GUIEditor_Window[4]) guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) guiSetVisible(GUIEditor_Window[4], false) showCursor(false) function VerLaGUI() guiSetVisible( "GUIEditor_Window[1]", true ) showCursor(true) end bindKey("F2", "down", VerLaGUI) ----------------------------------------------------- --Los Markers---- local marker = createMarker(2131.91846, -1149.65430, 23.4, "cylinder", 1.5, 255, 0, 0 ) ----------------------------------------------------- ----------------------------------------------------- --LasFunciones---- function VerLaGUI() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end bindKey("F2", "down", VerLaGUI) addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor_Button[12] ) then guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) showCursor(false) end end ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[2], true) guiSetVisible (GUIEditor_Window[3], true) showCursor (true) triggerServerEvent("lacamara", getRootElement(), hitPlayer) end end addEventHandler ("onClientMarkerHit", marker, markerHit) please ayudenme Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 Primero en : addEventHandler ("onClientMarkerHit", getRootElement(), markerHit) -- ahi estaba marker, no se porque.. Despues pusistes localPlayer en el lado del servidor jaja...Todavia no entendistes el triggerServerEvent El primer argumento te pide el nombre del evento ("lacamara"). Excelente. El segundo argumento pide el elemento destino del evento y vos pusiste getRootElement(), por lo cual el evento si lo manda a todos los jugadores y seguramente vos queres que sea solo al localPlayer. Por lo tanto Ahi reemplaza getRootElement() por localPlayer. El tercero te pide argumentos si es que tenes, vos pusiste hitPlayer, que la verdad es innecesario porque ya preguntastes la condicion en la funcion del onClientMarkerHit, asi que te recomiendo que lo saques. Luego pusiste que el camera Matrix se le ponga al source, por eso tenes que asegurar que sea el localPlayer (justamente lo que te explique en lo del segundo argumento). Te lo explique asi, porque quiero que entiendas...no me interesa arreglar, sino que se entienda el fix. Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 ? triggerServerEvent("lacamara", localPlayer(), hitPlayer) Pz ai lo fixie dime si tengo algo malo porfa : server function camara( hitPlayer ) setCameraMatrix( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) fadeCamera(true, 5) end end addEvent("lacamara", true) addEventHandler("lacamara", root, camara) ._. a y gracias por la ayuda ^^^^^^^^^ Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 Creo que te confundi, el setCameraMatrix y fade camera estaban bien y por otro lado el localPlayer va sin parentesis Por ultimo, pusistes dos end. Solo necesitas uno para la funcion porque el if lo sacaste Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 grax man me funciona pero como podria aserle para que con 1 boton el camera se pare ? con cancel event ? Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 Si vos queres que se pare la camara y vuelva al jugador haces esto : Usas el bindKey adentro del evento "lacamara" , pones la letra que queres usar para que se para la camara y el bindKey tiene que estar : 1) elJugador (el source) 2) la letra y el estado (a tu decision) 3) el nombre de la funcion que va a hacer que se vaya la camara y vuelva la vision al jugador. Te ayudo con la funcion que mira al jugador function volverCamara(player,key,keyState) -- Si miras la wiki, tiene tres parametros el bindKey (elJugador que presiona el boton, el boton y el estado) camaraPersona = setCameraTarget(player,player) if camaraPersona then -- comprabamos que ya esta mirando al jugador unbindKey(player,laLetra,elEstado,volverCamara) -- volverCamara es la funcion y player el jugador que presiono la letra end end Fijate si anda Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 pero y en que parte pongo el boton ._. ? Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 Si vos queres que se pare la camara y vuelva al jugador haces esto :Usas el bindKey adentro del evento "lacamara" , pones la letra que queres usar para que se para la camara y el bindKey tiene que estar : Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 ._. y como ago para llamar al boton al server-side ? es que no se ya que el button no tiene funcion esta suelto en el script : aqui ta el server-side function camara( hitPlayer ) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) fadeCamera(source, true, 5) if (source == GUIEditor_Button[12]) then setCameraMatrix(false) end end addEvent("lacamara", true) addEventHandler("lacamara", root, camara) Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 (edited) AHHHHHHHHHHHHHHHHHHHHH ya entendi lo que queres hacer...Pensaba que hablabas de un boton de teclado. EDIT : Estoy muy al pedo que casi te digo algo muy erroneo addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor_Button[12] ) then guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) showCursor(false) setCameraTarget(localPlayer,localPlayer) end end ) Fijate cambiar eso, en la parte del client-side Edited April 5, 2012 by Guest Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 me dirias como aserlo con el boton ? please Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 me dirias como aserlo con el boton ? please Ahi lo edite lo de arriba Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 man el player ahora aparece bajo la tierra no donde estaba Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 man el player ahora aparece bajo la tierra no donde estaba Probaste mas de una vez? Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 si man addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor_Button[12] ) then guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) showCursor(false) setCameraTarget(localPlayer,localPlayer) setElementPosition(localPlayer,2131.91846, -1149.65430, 23.4) -- La posicion del marker ,te lleva ahi. end end ) Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 man gracias y como podria aser para que en un lugar especifico se cree un vehiculo con el ID que tengo en la tabla de autos en el gridlist ? al hace click ? Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 man gracias y como podria aser para que en un lugar especifico se cree un vehiculo con el ID que tengo en la tabla de autos en el gridlist ? al hace click ? addEventHandler("onClientGUIClick",GUIEditor_Grid[1], function() local auto = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) local x,y,z = getElementPosition(localPlayer) createVehicle(auto,x,y,z) end end Fijate no se si esta bien la verdad Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 man yo quiero un auto para la camara matrix asi cuando el player presione el row del vehiculo se cree ese vehiculo me entiendes ? please ayudame Link to comment
Edikosh998 Posted April 5, 2012 Share Posted April 5, 2012 addEventHandler("onClientGUIClick",GUIEditor_Grid[1], function() local auto = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) createVehicle(auto,1468.388671875, -918.42474365234, 99.881813049316) end end Esto querias? Link to comment
iFoReX Posted April 5, 2012 Author Share Posted April 5, 2012 ise esto man : ----------------------------------------------------- --Elauto---- function Prototipe() local auto = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) createVehicle(auto,-1655.20386, 1209.95129, 21.15625) end addEventHandler("onClientGUIClick",GUIEditor_Grid[1],Prototipe) ayudado de lo que tu me diste pero no aparece el auto Link to comment
Recommended Posts