Jump to content

0xCiBeR

MTA Team
  • Posts

    1,673
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by 0xCiBeR

  1. Ahi no estas usando la funcion que te di. Genera algo asi: Si combinas varios de ellos, y usas onClientRender o algun timer para renderizarlos, al mismo que usas: isLineOfSightClear Lo puedes lograr. PD:Igual tienes varias maneras de lograrlo.
  2. Una manera que se me ocurre es reemplazar la textura con uno rojo, o usas un shader. Luego para que suba hasta el cielo, usas: fxAddDebris
  3. Poder, se puede. Yo lo he hecho para mi server de Zombies. Aun no es nada facil, ya que debes compensar cosas como por ejemplo la duracion de la animacion. Con la cuestíon de la vida, podes utilizar el extra_health de Solid.
  4. Podrias probar cambiar los eventos.
  5. function arma1() triggerServerEvent ( "onArmas1", localPlayer,localPlayer ) end function a1(jugador) giveWeapon ( jugador, 346, 5000,false ) end addEvent( "onArmas1", true ) addEventHandler( "onArmas1", getRootElement(), a1 ) Tambien podes ahorrarte el pasaje de variables usando "client" de esta manera: function arma1() triggerServerEvent ( "onArmas1", localPlayer ) end function a1() giveWeapon ( client, 346, 5000,false ) end addEvent( "onArmas1", true ) addEventHandler( "onArmas1", getRootElement(), a1 )
  6. También agregue: isGuestAccount Ya que siempre es mejor comprobar si no esta logueado para evitar errores y además ahorrar recursos. PD:Siempre recuerda Optimizar Tus scripts. Saludos.
  7. Es una variable que use para identificar el estado de la ventana. Podes usar un string o una boolean. Lo recomendable es una boolean,(true,false)
  8. Usa esto: -------Objetos------ createObject ( 1570, 220.8, 1922, 18, 0, 0, 0 ) createPed ( 179, 220.5, 1922.7, 17.8, 180.0 ) tienda = createMarker ( 220.3, 1920.3, 16.6, "cylinder", 1.5, 255, 0, 0, 255 ) abierto = false -------Panel De Armas-------- function panel() ventana = guiCreateWindow(95, 108, 654, 397, "Panel De Armas", false) guiWindowSetSizable(ventana, false) guiSetAlpha(ventana, 0.70) boton1 = guiCreateButton(45, 49, 115, 93, "", false, ventana) img1 = guiCreateStaticImage(-82, 10, 194, 148, ":guieditor/images/examples/1.png", false, boton1) boton2 = guiCreateButton(207, 49, 115, 93, "", false, ventana) img2 = guiCreateStaticImage(-41, 10, 147, 121, ":guieditor/images/examples/2.png", false, boton2) boton3 = guiCreateButton(365, 49, 115, 93, "", false, ventana) img3 = guiCreateStaticImage(-90, 10, 196, 158, ":guieditor/images/examples/3.png", false, boton3) boton4 = guiCreateButton(45, 156, 115, 93, "", false, ventana) img4 = guiCreateStaticImage(-23, 36, 147, 84, ":guieditor/images/examples/4.png", false, boton4) boton5 = guiCreateButton(207, 156, 115, 93, "", false, ventana) img5 = guiCreateStaticImage(-19, 29, 135, 106, ":guieditor/images/examples/5.png", false, boton5) boton6 = guiCreateButton(365, 156, 115, 93, "", false, ventana) img6 = guiCreateStaticImage(-20, 27, 136, 83, ":guieditor/images/examples/6.png", false, boton6) boton7 = guiCreateButton(45, 263, 115, 93, "", false, ventana) img7 = guiCreateStaticImage(-101, 4, 211, 111, ":guieditor/images/examples/7.png", false, boton7) boton8 = guiCreateButton(207, 263, 115, 93, "", false, ventana) img8 = guiCreateStaticImage(-7, 29, 122, 64, ":guieditor/images/examples/10.png", false, boton8) boton9 = guiCreateButton(365, 263, 115, 93, "", false, ventana) img9 = guiCreateStaticImage(-14, 28, 130, 72, ":guieditor/images/examples/13.png", false, boton9) cerrar = guiCreateButton(516, 156, 128, 93, "Cerrar", false, ventana) addEventHandler ( "onClientGUIClick", cerrar, Exit ) addEventHandler ( "onClientGUIClick", boton1, arma1 ) addEventHandler ( "onClientGUIClick", boton2, arma2 ) addEventHandler ( "onClientGUIClick", boton3, arma3) addEventHandler ( "onClientGUIClick", boton4, arma4) addEventHandler ( "onClientGUIClick", boton5, arma5) addEventHandler ( "onClientGUIClick", boton6, arma6 ) addEventHandler ( "onClientGUIClick", boton7, arma7 ) addEventHandler ( "onClientGUIClick", boton8, arma8 ) addEventHandler ( "onClientGUIClick", boton9, arma9 ) addEventHandler("onClientRender", root, function() dxDrawLine(600, 154, 600, 476, tocolor(255, 255, 255, 255), 1, true, ventana) end ) ------Funciones------ function MarkerHit() guiSetVisible (ventana, true) showCursor ( true ) abierto = true end function Exit() guiSetVisible (ventana, false ) showCursor ( false ) abierto = false end addEventHandler ( "onClientMarkerHit", tienda, MarkerHit) addEventHandler ( "onClientMarkerLeave", tienda, Exit) Sobre las imagenes, en tu caso, asegurate de tener el resource guieditor en funcionamiento ya que estas llamando a imagenes en otro resource. Puedes evitar activar guieditor, copiando esas imagenes al directorio de tu resource, agregandolas al meta con el formato y cambiando todas las rutas de las imagenes, a las nuevas copias de imagenes. Y esto no se que has querido hacer:(Imagino que tienes funciones como arma1,arma2 etc..) addEventHandler ( "onClientGUIClick", cerrar, Exit, false ) addEventHandler ( "onClientGUIClick", boton1, arma1, false ) addEventHandler ( "onClientGUIClick", boton2, arma2, false ) addEventHandler ( "onClientGUIClick", boton3, arma3, false ) addEventHandler ( "onClientGUIClick", boton4, arma4, false ) addEventHandler ( "onClientGUIClick", boton5, arma5, false ) addEventHandler ( "onClientGUIClick", boton6, arma6, false ) addEventHandler ( "onClientGUIClick", boton7, arma7, false ) addEventHandler ( "onClientGUIClick", boton8, arma8, false ) addEventHandler ( "onClientGUIClick", boton9, arma9, false ) PD:Cuando trabajas con gran cantidad de cosas, mi recomendación es la utilización de tablas.
  9. Si quieres hacerla por comandos, puedes hacer comandos variados..Ej /puerta1 Y con ese mismo comando, abres y cierras la puerta.. Yo hize un script de demostración con variaciones de comando..El link es: Este Dentro del lua de ese script esta explicado todo en como variar un comando, y el uso de variables globales para determinar el estado de algo..En este caso, si esta abierto o cerrado.
  10. +1 @Forrest: local checkX = ( absoluteX > sX/4 and absoluteX < 2*sX/4-sX/8 ) local checkY = ( absoluteY > sY/4 and absoluteY < 2*sY/4-sY/8 ) The sX/4 and sX/8 and sY/4 and sY/8 are the position and boundaries of the dxRectangle. So that's why you use it in your check function.What you do, is remove the position used to create the dxRectangle.
  11. local vehicleID = getVehicleModelFromName (vehicleName) vehicle1 = createVehicle( vehicleID, 2045, -2348, 13.8, 0, 0, 90 ) warpPedIntoVehicle( localPlayer, vehicle1 ) setCameraTarget( localPlayer )
  12. You are not posting the full script, anyway, what it is doing there is checking with "onClientClick" this variables: string button, string state, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ, element clickedWorld The X and Y positions in your script refer to the absoluteX and absoluteY positions in the event variables. Example this would be the same thing but, with the onClientClick Variables.: local sX, sY = guiGetScreenSize() addEventHandler ( "onClientClick", getRootElement(), function (button,state,absoluteX,absoluteY) local checkX = ( absoluteX > sX/4 and absoluteX < 2*sX/4-sX/8 ) local checkY = ( absoluteY > sY/4 and absoluteY < 2*sY/4-sY/8 ) end) function draw() dxDrawRectangle(sX/4, sY/4, sX/8, sY/8, tocolor(0,255,0,255), false) end addEventHandler ( "onClientRender", getRootElement(), draw ) So what it actually does, is that when you click on somewhere in the screen, the event handler triggers a function that checks the position of that click and resolves if you are actually clicking the dxRectangle or not.
  13. Las funciones de MTA, son practicamente ilimitadas..Solo basta un poco de conocimiento y Ideas para lograrlo..Si lees la Wiki te vas a poder guiar bien. Cualquier otra cosa, avisa..Saludos
  14. Handler Function Server-Side: function functionName ( player keyPresser, string key, string keyState, [ var arguments, ... ] )
  15. function sonido(cmd,url) if url then playSound(url) end end addCommandHandler("url",sonido)--El comando seria /url [LINK AL SONIDO]
  16. -_____- y tu aporte al problema?.Ninguno....
  17. Lo estas poniendo en el lugar equivocado. Si es un "right" debes colocarlo en el ACL de Admin. Este grupo esta casi a lo ultimo del archivo acl.xml . Si no entiendes, mira ACA
  18. Para eso mejor usa: playSound EJ: function sonido(jugador,cmd,url) if url then playSound(url) end end addCommandHandler("url",sonido)--El comando seria /url [LINK AL SONIDO]
×
×
  • Create New...