Jump to content

#Dv^

Members
  • Posts

    459
  • Joined

  • Last visited

4 Followers

About #Dv^

  • Birthday 14/08/1997

Details

  • Gang
    !Rl
  • Location
    Argentina
  • Occupation
    Programing
  • Interests
    Scripting

Recent Profile Visitors

5,181 profile views

#Dv^'s Achievements

Hustler

Hustler (26/54)

40

Reputation

  1. Puedes mover la función 'waterOn' a server-side, al momento de usar el comando triggearlo a todos los jugadores conectados para luego desde client-side obtener a ese jugador guardado en una variable quizás para luego renderizar los objetos debajo de él. Otra es no triggearlo, sino al momento de usar el comando adherirle al jugador alguna key con elementData para sincronizarlo tanto client-side como server-side, y desde client-side hacer un loop de jugadores dentro del evento render con la condición de la 'key' elementData que te mencioné y así crear los objetos debajo de él para que todos logren verlo. No sé que tan óptimo podría ser eso, pero es una idea así rápida. Espero se entienda ?
  2. Buenas, si aún sigues en búsqueda envíame imbox.
  3. Espero te sirva este, no lo revisé bien. -- Client-side addEventHandler("onClientKey", root, function(button, press) if button == "lctrl" then setElementData(localPlayer, "lctrl", press and true or false, false) end if button == "a" and press then local pressed = getElementData(localPlayer, "lctrl") or false if pressed then print("lctrl + a combination was pressed!") triggerServerEvent("createbox", localPlayer) end end end) -- Server-side function creabox(jugador1) local nivel = (getElementData(jugador1, "Level") or 0) if (nivel<=10) then triggerClientEvent(jugador1, "TextoNivelRequerido", jugador1) return end if (nivel>=10) then local x, y, z = getElementPosition(jugador1) local r = getPedRotation(jugador1) caja1 = createObject(1230, x - math.sin( math.rad( -r )) * ( 1.25 ), y - math.cos( math.rad( -r )) * (1.25), z + 1, 0, 0, 0) setTimer(destroyElement, 5000, 1, caja1) end end addCommandHandler("caja1", createbox) addEvent("createbox", true) addEventHandler("createbox", root, function() createbox(source) end)
  4. Quizás puedas intentar usar onClientKey o getKeyState desde el lado client-side, que cuando haga la combinación de teclas uses triggerServerEvent para sincronizar al jugador que usó la combinación.
  5. Muestra como lo has modificado.
  6. Si aún sigues en búsqueda, contacta conmigo por Discord _Dv^#0410 Saludos.
  7. I use this code to do what I want exports.bone_attach:setElementBoneRotationOffset(object, 180, 40, 0) local data = exports.bone_attach:getElementBoneAttachmentDetails(object) local rx, ry, rz = convertRotationMatrixToEulerAngles(data[6]) print(rx, ry, rz) -- return -140, -5.3751111671239e-15, 180
  8. @Tekken Thank you very much for your help! I have used its helpful, but when obtaining the data it gives me wrong numbers. If I rotate X = 90, I should rotate the same with the matrix but it returns other numbers
  9. Hi everyone!, I have a query regarding this script. I am wanting to rotate an object obtaining its rotation through the function getElementBoneAttachmentDetails and it returns a matrix, of which I do not know how to use it. Would you give me a guide to try to understand? https://forum.multitheftauto.com/topic/128821-rel-new-bone-attach-using-onclientpedsprocessed-and-useful-function-attachelementtobone/?tab=comments#comment-992075 I don't know how to get the integers rx, ry, rz of the rotation of the object through a matrix Thanks for the help
  10. Verifica que los módulos sean del tipo .sha. Utiliza estos módulos con compatibilidad Linux: https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL
  11. #Dv^

    PlayerChat

    No es necesario que crees un colshape para obtener a los jugadores dentro del él. Puedes usar getDistanceBetweenPoints3D para calcular la distancia y poner una condicional con ello. En el evento onPlayerChat, si miras su primer ejemplo puedes observar como está estructurado así, con lo mismo que buscas..., a excepción de que quieres poner la cuenta de la persona de quien manda el mensaje. Te recomendaría poner una condicional o "or" respecto a getAccountName, debido a que te puede retorna false si el jugador tiene una cuenta invitado. Lo mismo con getPlayerTeam, podría darte error si el jugador no está en un equipo y por lo tanto el "pairs" no podrá hacer bucle con la tabla que no existe.
  12. https://community.multitheftauto.com/index.php?p=resources&s=details&id=15958
  13. Te envié solicitud.
  14. Si sigues en la búsqueda, contáctame al privado.
  15. La useful getPointFromDistanceRotation te puede ayudar a este problema, mira su ejemplo. -- Uselful function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end -- Server-side addCommandHandler("explosion", function (player) local x,y,z = getElementPosition(player); for i=1, 8 do local newX, newY = getPointFromDistanceRotation(x, y, 2, 360 * (i/8)); createExplosion(newX, newY, z, 0, player) end end );
×
×
  • Create New...