Jump to content

Raxzen

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Raxzen's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Thank you, very interesting post I tried to do it in something simple, an "onClientMarkerHit", but I see that there are many variants to consider, anyway thanks for the help
  2. Hello everyone I have a question I'm practicing scripting and trying to do something "simple", which led to a lot of questions I saw the wiki, the setWeaponProperty function. How is it applied in client? I tried to do something simple with the SPAZ, but when I run the script locally the result is that "excpected weapon at argument [1, got number (27) Can someone be kind to explain to me how it works on client-side, thanks
  3. Saludos gente, estoy probando el setWeaponPropiety en las armas pesadas del juego, pero estoy comprobando cuales funcionan y cuales no, al parecer algunas no son modificables para este tipo de armas (minigun, hs, rocket, lanzallamas), alguien me puede decir (si es que tiene conocimiento) que propiedades si se pueden aplicar, así no pierdo mucho tiempo probando una x una
  4. Trate de acomodar tu código, y me sirvió la parte del warped intovehicle xd, pero con unas ligeras modificaciones, a pesar de eso trate de aplicar la finción para evitar que el usuario spawnee mas de un auto, pero no e tenido resultado, alguna otra forma de orientar
  5. Hi, I have been introducing to programming in Lua through MTA and I had some doubts to see if you can clarify, I hope this subforum is correct, it is a panel for spawning cars, and achieved basic functionality through the wiki, but I have a problem in which I hope you can help me Client: function generar_auto(boton,estado) local fila,columna = guiGridListGetSelectedItem(grid_autos) if fila and columna and fila ~= -1 and columna ~= -1 then local selected = guiGridListGetItemData(grid_autos,fila,columna) selected = tonumber(selected) local rotz = getElementRotation(getLocalPlayer()) local x,y,z = getElementPosition(getLocalPlayer()) x = x + ( math.cos ( math.rad ( rotz+90 ) ) * 3) y = y + ( math.sin ( math.rad ( rotz+90 ) ) * 3) if selected and x and y and z then triggerServerEvent("onClientGenerarAuto",getRootElement(),selected,x,y,z) else outputChatBox("No spawneo") end else outputChatBox("Error") end end Server: function generar_auto(vehiculo,posx,posy,posz,player) -- check all the arguments exist if vehiculo and posx and posy and posz then createVehicle(vehiculo,posx,posy,posz) outputChatBox("Auto creado",source) end end This part of the code is what allows me to create the car and as I said everything is fine, it does, but I would like to put the user inside it directly, when using the warPedIntoVehicle on the server but it doesn't find the argument and it doesn't put it The other is how I can limit the spawn of the cars to only 1, since if I keep clicking the button it follows me and keeps creating cars. PS: I am using the wiki, exactly this link, it is the same code but with slight changes in variables: https://wiki.multitheftauto.com/wiki/Scripting_the_GUI_-_Tutorial_1 THANK YOU, I really sorry for mi english, I used google translate
  6. Saludos estimados usuarios de la comunidad, me e estado introduciendo a la programación en Lua mediante MTA y tenía unas dudas para ver si me las pueden aclarar, espero este subforo sea el correcto, se trata de un panel para spawnear autos, e logrado la funcionalidad básica mediante la wiki, pero tengo un problema en el que ojala me puedan ayudar Cliente: function generar_auto(boton,estado) local fila,columna = guiGridListGetSelectedItem(grid_autos) if fila and columna and fila ~= -1 and columna ~= -1 then local selected = guiGridListGetItemData(grid_autos,fila,columna) selected = tonumber(selected) local rotz = getElementRotation(getLocalPlayer()) local x,y,z = getElementPosition(getLocalPlayer()) x = x + ( math.cos ( math.rad ( rotz+90 ) ) * 3) y = y + ( math.sin ( math.rad ( rotz+90 ) ) * 3) if selected and x and y and z then triggerServerEvent("onClientGenerarAuto",getRootElement(),selected,x,y,z) else outputChatBox("No spawneo") end else outputChatBox("Spawneo correctamente") end end Servidor: function generar_auto(vehiculo,posx,posy,posz,player) -- check all the arguments exist if vehiculo and posx and posy and posz then createVehicle(vehiculo,posx,posy,posz) outputChatBox("Auto creado",source) end end Esta parte del código es la que me permite crear el auto y como dije todo bien, lo hace, pero me gustaría meter al usuario dentro de el directamente, al utilizar el warPedIntoVehicle en el servidor pero no encuentra el argumento y no lo mete La otra es como puedo limitar el spawn de los autos a solo 1, ya que si le sigo dando click al botón me sigue y sigue creando autos. PD: estoy usando la wiki, exactamente este link, es el mismo código pero con ligeros cambios en variables https://wiki.multitheftauto.com/wiki/Scripting_the_GUI_-_Tutorial_1 Agradezco la ayuda
×
×
  • Create New...