Jump to content

Lalalu

Members
  • Posts

    202
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Lalalu

  1. Lalalu

    Dx Animation

    Hola, estoy creando una barra de carga usando Dx, quisiera añadirle una animación tipo gif pero hacerlo sin usar un gif como tal sino 2 imágenes que se intercambien cada cierto tiempo, por ejemplo a la barra le añadiré un icono de un persomaje corriendo son 2 iconoa uno con las piernas abiertas y otro con las piernas cerradas simulando que corre al intercambiarse ambas imágenes, no sé si me doy a explicar. No sé como lograr que ocurra ese intercambio constante de una imagen por la otra, menos que use el addEventHandler y removeEventHandler con setTimer lol
  2. Hello, If I use It that way the image communicates with other players. For example If I active this by a command, and someone else uses this command at the same time that I'm using It then the image communicates with other player, dissapears, appears on both, and things like that.
  3. Hello again, @Shady1 help me a lot! (thank you☆). It works with that. triggerClientEvent(source, "Emoji5:activarEfecto", source, OnEnmojiRender) ---i've tried with this and same, it works. triggerClientEvent(source, "Emoji5:activarEfecto", root, OnEnmojiRender) But no one can see the image that i have created, @Shady1 i've tried with setElementVisibleTo but It's not working, still no one can see the image :(. Any other recommendation or something to use that allow other players see the image i have created? and also that i can se their images..
  4. Hello, this is a following topic to an old one... It works a little better with the lines you helped me last time, but the image keeps disappearing when another player uses it at the same time as me, or after me, and it disappears on me too. It is as if it communicates with the rest of players when creating or removing the image... @Shady1 local sX, sY = guiGetScreenSize ( ) local onEmoji5 = {}; local plyEmoji5 = getElementsByType ( "player" ) local showEmoji5 = false local alphaEmoji5 = 0; tickEmoji5 = 0; local isEventEmoji5Added = false function onEmoji5Render ( ) local cx, cy, cz = getCameraMatrix () for i = 1, #plyEmoji5 do local pEmoji5 = plyEmoji5[i] if ( onEmoji5[pEmoji5] ) then if (getElementData (pEmoji5, "Emoji5") == true) then local x, y, z = getPedBonePosition ( pEmoji5, 6 ); local dEmoji5 = getDistanceBetweenPoints3D ( cx, cy, cz, x, y, z ); if ( dEmoji5 < 100 ) then if ( isLineOfSightClear ( cx, cy, cz, x, y, z, true, true, false, false, true, false, false, localPlayer ) ) then local sx, sy = getScreenFromWorldPosition ( x, y, z+0.4 ); if ( sx ) and ( sy ) then local sEmoji5 = 400 / dEmoji5; if showEmoji5 then alphaEmoji5 = interpolateBetween(alphaEmoji5,0,0,0,0,255,(getTickCount()-tickEmoji5)/1000, "InBounce") end dxDrawImage ( sx - ( sEmoji5 / 2 ), sy - ( sEmoji5 / 2 ), sEmoji5, sEmoji5, "Images/Effects/T_UI_Message_Icon_Shousan_BC.webp", 0, 0, 0, tocolor ( 255, 255, 255, alphaEmoji5 ) ) end end end end end end end function attachEmoji5 ( Emoji5 ) if not ( Emoji5 and isElement ( Emoji5 ) ) then return end if(isEventEmoji5Added) then return end -- if event added don't go onEmoji5[Emoji5] = true addEventHandler ( "onClientRender", root, onEmoji5Render ) alphaEmoji5 = 255 showEmoji5 = false setTimer(function() tickEmoji5 = getTickCount() showEmoji5 = not showEmoji5 end, 1000, 1) isEventEmoji5Added = true -- mark as added setTimer(function() removeEventHandler ( "onClientRender", root, onEmoji5Render ) isEventEmoji5Added = false -- mark as deleted end, 2000, 1) end addEvent( "Emoji5:activarEfecto", true ) addEventHandler( "Emoji5:activarEfecto", root, attachEmoji5 ) I'm using this for the server side trigger: triggerClientEvent("Emoji5:activarEfecto", root, source ) setElementData(source, "Emoji5", true)
  5. Hola qué tal, quisiera saber si existe alguna forma de poder seleccionar a un jugador sin importar que este lejos con el mouse2 o click derecho, sin necesitar arma. No se si me explico, lograr como apuntarlo pero sin arma y desde un poco lejos ¿Qué funciones pudiese usar? Esto es lo que quiero tratar de lograr: https://ibb.co/8gYfp9S
  6. Gracias, sí eso mismo utilice igual para eliminar el daño de las caídas con un cancel event
  7. Hello, I need your help. I created a Gridlist using guieditor, it basically shows if you have a coin type available, gold or silver. If don't have coins the text of the row will show a "0" in red color, if you have more than 1 then the amount you have will be shown in green color. My problem is that this list does not update when i open the panel. If I don't have a coin the text will show 0, but if I give the coin to myself for example and then open my panel again the balance is not updated, it continues to show "0" unless I restart the script. I tried using "guiGridListClear" , but the list disappears completely. Here is a small part of my gridList code: SLOT1 = guiCreateTab("SLOT 1", TabWindow) Gridlist_Slot1 = guiCreateGridList(10, 10, 684, 358, false, SLOT1) colum = guiGridListAddColumn(Gridlist_Slot1, "SELECT", 0.5) colum2 = guiGridListAddColumn(Gridlist_Slot1, "AVAILABLE", 0.2) for i = 1, 2 do guiGridListAddRow(Gridlist_Slot1) end local Gold = exports.Points_system:getPlayerGold(localPlayer) guiGridListSetItemText(Gridlist_Slot1, 0, 1, "Gold Insignia", false, false) if Gold == 0 then guiGridListSetItemText(Gridlist_Slot1, 0, 2, ""..Gold, false, false) guiGridListSetItemColor(Gridlist_Slot1, 0, 2, 255, 0, 0, 255) end if Gold >= 1 then guiGridListSetItemText(Gridlist_Slot1, 0, 2, ""..Gold, false, false) guiGridListSetItemColor(Gridlist_Slot1, 0, 2, 0, 255, 0, 255) end local Silver = exports.Points_system:getPlayerSilver(localPlayer) guiGridListSetItemText(Gridlist_Slot1, 1, 1, "Silver Insignia", false, false) if Silver == 0 then guiGridListSetItemText(Gridlist_Slot1, 1, 2, ""..Silver, false, false) guiGridListSetItemColor(Gridlist_Slot1, 1, 2, 255, 0, 0, 255) end if Silver == 1 then guiGridListSetItemText(Gridlist_Slot1, 1, 2, ""..Silver, false, false) guiGridListSetItemColor(Gridlist_Slot1, 1, 2, 0, 255, 0, 255) end
  8. Thank you, I will try with that
  9. Hello everyone, I need your help with something... I'm gonna show you a simple code (server-side) that creates a moving object with moveObject; function moveObjectTest(player) local x, y, z = getElementPosition (player) local r = getPedRotation(player) local object = createObject(8417, x+math.sin(math.rad(-r))*(1.5),y+math.cos(math.rad(-r))*(1.5),z-0.2, 0, 0, r) moveObject (object,700,x+math.sin(math.rad(-r))*25,y+math.cos(math.rad(-r))*25,z-0.3,0,50,0) end addCommandHandler ("move", moveObjectTest) I want to know how can I stop the object movement only when It hits Walls or Peds instead of using timer or x - y position, I mean, by detecting the impact with other collision and then the object stop moving (sorry for my english?)
  10. Hola qué tal, quisiera saber como puedo lograr que no se ejecute la Animación de daño cuando caes de mucha altura? (Esa cuando cae al suelo y luego se levanta, adjunto gif). En mi servidor por defecto tengo desactivado el daño de las caídas, así que usar onPlayerDamage no me funciona, claro que activando el daño estas si me funciona bien, pero necesito mantenerlo desactivado. ¿Qué otra cosa podría usar para que esas animaciones no se ejecuten, o se ejecute otra sin tener que usar onPlayerDamage?
  11. Thank everyone for the help, It works better now after modifying the trigger and the lines you helped me with
  12. Hi, this is my trigger: function EMOJI_Z1 () triggerClientEvent("StartEmoji", root, source ) setElementData(source, "Emoji1", true) setTimer(setElementData, 2000, 1, source, "Emoji1", false) end addEvent ( "EMOJI_Z1", true ) addEventHandler ( "EMOJI_Z1", root, EMOJI_Z1 )
  13. Hola, muchas gracias a todos por la ayuda. He intentando de las formas que me han explicado #Dv y Dark, a lo que he podido entender pero no me ha funcionado, no lo ven los demás o causa muchos bajones de fps. Alex si me sirvió tu forma, pero el player se desliza al estar sobre el agua y si por ejemplo lo tengo activado yo y alguien sale del servidor se me desactiva. Lo del deslizamiento siempre me pasa cuando trato de crear el objeto en server-side porque no podía colocarlo con el getWaterLevel, de esta forma si funciona perfecto pero añadiéndolo al render en el client-side local level = getWaterLevel(x,y,z) or 0 object = createObject(1221, x, y, level)
  14. Hello, I have a problem with this code, this creates a Dx on you that other players can see, it is activated with a trigger from the server-side and a setElementData, but when I use it at the same time as someone else the render gets bug, It says that it was already handled.. local sX, sY = guiGetScreenSize ( ) local onEmoji4 = {}; local plyEmoji4 = getElementsByType ( "player" ) local showEmoji4 = false function onEmoji4Render ( ) local cx, cy, cz = getCameraMatrix () for i = 1, #plyEmoji4 do local p = plyEmoji4[i] if ( onEmoji4[p] ) then local x, y, z = getPedBonePosition.. --- -- blag blah blah local dEmoji4 = getDistanceBetweenPoints3D ( cx... -- blag blah blah if ( dEmoji4 < 100 ) then if ( isLineOfSightClear ( cx, cy... -- blag blah blah if (getElementData (p, "Emoji4") == true) then local sx, sy = getScreenFromWorldPosition...-- blag blah blah if ( sx ) and ( sy ) then local sEmoji4 = 400 / ...-- blag blah blah dxDrawImage ( sx - ( sEmoji4 / 2 ), sy - ( sEmoji4 / 2 ), sEmoji4, sEmoji4, "T_UI_Message_Icon_Aisatsu_BC.webp", 0, 0, 0, tocolor ( 255, 255, 255, 255 ) ) end end end end end end end function attachEmoji4 ( Emoji4 ) if not ( Emoji4 and isElement ( Emoji4 ) ) then return end onEmoji4[Emoji4] = true addEventHandler ( "onClientRender", root, onEmoji4Render ) setTimer(function() removeEventHandler ( "onClientRender", root, onEmoji4Render ) end, 2000, 1) end addEvent( "StartEmoji", true ) addEventHandler( "StartEmoji", root, attachEmoji4 )
  15. O sea pero mantengo la creación del objeto en el client side?? anteriormente lo único que habia hecho fue colocar un triggerClient para crear el render
  16. Hola que tal, quisiera que me orientaran en algo. Hay un código de un usuario aquí en el foro que permite caminar en el agua utilizando la creación de un objeto y render bajo el jugador, el problema es que esto solo lo ve el jugador que lo ejecuta, no pueden verlo los demás. He intentado con un trigger desde el server side pero no he podido lograr que funcione, quisiera que me orientaran al respecto para lograr que los demás players te vean caminando sobre el agua... por acá adjunto el código original y post del usuario: https://forum.multitheftauto.com/topic/58614-water-walk/ -- water walk local obj = {} function WaterWalk() if obj[localPlayer] then local x,y,_ = getElementPosition(localPlayer) setElementPosition(obj[localPlayer],x,y,-.5) end end addEventHandler ("onClientRender",root,WaterWalk) function WaterOn() local px,py,_ = getElementPosition(localPlayer) obj[localPlayer] = createObject(1221,px,py,0) setElementAlpha(obj[localPlayer],0) end addCommandHandler("water",WaterOn)
  17. Hola, tanto tiempo. Hago este post para realizar una pregunta... el siguiente código (client side) crea peds con distintas posiciones en su respectiva tabla, he tenido un problema: quiero que al matar un ped ESE específicamenre el que maté se destruya y reaparezca en 20 segundos pero al matarlo lo que sucede es que todos los peds de la tabla se destruyen, espero su ayuda.... por aquí dejo una pequeña parte de mi tabla; local PedPlaces = { {-1556, 2355, 10, 350}, {-1346, 2255, 10, 250}, {-1256, 2155, 10, 123}, {-1217, 1667, 10, 69} } for i, v in pairs (PedPlaces) do PED = createPed(15,v[1],v[2],v[3], v[4]) end
  18. Hola, tanto tiempo. Hago este post para realizar una pregunta... el siguiente código (client side) crea peds con distintas posiciones en su respectiva tabla, he tenido un problema: quiero que al matar un ped ESE específicamenre el que maté se destruya y reaparezca en 20 segundos pero al matarlo lo que sucede es que todos los peds de la tabla se destruyen, espero su ayuda.... por aquí dejo una pequeña parte de mi tabla; local PedPlaces = { {-1556, 2355, 10, 350}, {-1346, 2255, 10, 250}, {-1256, 2155, 10, 123}, {-1217, 1667, 10, 69} } for i, v in pairs (PedPlaces) do PED = createPed(15,v[1],v[2],v[3], v[4]) end
  19. Hola, quisiera saber como puedo crear un circulo de explosiones en una posición delante de mi específicamente, me refiero a varias explosiones que formen una especie de circulo en 360 grados
  20. Lalalu

    Marker Team

    Hola, cree un marker que muestra una ventana GUI sólo a un Team en específico, el problema es que si activo el script y no estoy en el team y me seteo debo reiniciar el script nuevamente para que compruebe que si estoy en el team, no hay alguna forma para detectar cuando el jugador cambie de team? O algo para que cuando este este en otro team y se setee al team del marker este reconozca que está en el team sin reiniciar el script, no se si me di a entender
  21. Lalalu

    Draw ACL

    Hola, quisiera saber como puedo dibujar un grupo ACL con Dx
  22. Lalalu

    GetAllWeapons

    Hola, quisiera saber si existe algún método para detectar el arma que tiene un jugador, pero no la que este esté usando al momento, solamente para detectar si la tiene?
  23. Lalalu

    Pasos Sounds

    Hola, quisiera saber si existe una función para detectar los pasos que da un jugador, mejor dicho cuando este camine o corra, no lo sé, estoy tratando de agregar un sonido nuevo a los pasos del jugador.
  24. No pude copiarlo, no estoy en pc
×
×
  • Create New...