Jump to content

[Ayuda]rotacion explosion


Nicolas ECM

Recommended Posts

Posted

Hola a todos tengo una duda se puede hacer que se cree una explosion con la rotacion que tiene el que usa el comando

function asdfg(sourcePlayer)

local x, y, z = getElementPosition ( sourcePlayer )

local xx, yy, zz = getElementRotation ( sourcePlayer )

setElementRotation ( explo, xx, yy, zz )

explo = createExplosion ( x , y + 3, z, 11 )

end

addCommandHandler("a", asdfg)

intente hacerlo asi pero no pude me manda error quien me puede ayudar porfavor.

Posted
Hola a todos tengo una duda se puede hacer que se cree una explosion con la rotacion que tiene el que usa el comando

function asdfg(sourcePlayer)

local x, y, z = getElementPosition ( sourcePlayer )

local xx, yy, zz = getElementRotation ( sourcePlayer )

setElementRotation ( explo, xx, yy, zz )

explo = createExplosion ( x , y + 3, z, 11 )

end

addCommandHandler("a", asdfg)

intente hacerlo asi pero no pude me manda error quien me puede ayudar porfavor.

¿Donde defines la posición?

9pJCpYX.png
Posted

como asi?, tengo eso echo y eso crea una explosion cerca a mi pero quiero que sea como un objeto

function add(sourcePlayer)

local x, y, z = getElementPosition ( sourcePlayer )

local xxx, yyy, zzz = getElementRotation ( sourcePlayer )

objeto = createObject( 2419, x, y, z + 5, xxx , yyy , zzz + 90)

end

addCommandHandler("a", add)

que le pueda colocar la rotacion que tiene el que usa el comando

Posted

No entendí, quizás es esto.

  
function add(sourcePlayer) 
local x, y, z = getElementPosition ( sourcePlayer ) 
local xxx, yyy, zzz = getElementRotation ( sourcePlayer ) 
objeto = createObject( 2419, x, y, z + 5, xxx , yyy , zzz + 90) 
setElementRotation(objeto,xxx,yyy,zzz) 
end 
addCommandHandler("a", add)  
  

Currently developing for International Gaming Community - Join us!

Posted

Como va a tener rotacion una explosion? no tiene el menor sentido lo que decis.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Osea queres que aparezca enfrente del jugador?

Podes utilizar las funciones de matrices, las cuales facilitan esto muchisimo.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
addCommandHandler ( "explosion", 
    function ( thePlayer ) 
        local x, y, z = getElementPosition ( thePlayer ) -- Obtengo la posicion del jugador 
        local rx, ry, rz = getElementRotation ( thePlayer ) -- Obtengo la rotacion del jugador 
        local mat = Matrix.create ( x, y, z, rx, ry, rz ) -- Creo la matrix usando la posicion y la rotacion 
        local forward = Matrix.getForward ( mat ) -- Obtengo la posicion en frente del jugador 
        local pos = ( Matrix.getPosition ( mat ) + forward ) -- Sumo ambos vectores 
        createExplosion ( pos, 11 ) 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
solid pero hay un problema, como hago para alejar la explosion de donde yo estoy.
  
    addCommandHandler ( "explosion", 
        function ( thePlayer ) 
            local x, y, z = getElementPosition ( thePlayer ) -- Obtengo la posicion del jugador 
            local rx, ry, rz = getElementRotation ( thePlayer ) -- Obtengo la rotacion del jugador 
            local mat = Matrix.create ( x, y, z, rx, ry, rz ) -- Creo la matrix usando la posicion y la rotacion 
            local forward = Matrix.getForward ( mat ) -- Obtengo la posicion en frente del jugador 
            local pos = ( Matrix.getPosition ( mat ) + forward+3 ) -- Sumo ambos vectores 
            createExplosion ( pos, 11 ) 
        end 
    ) 
  

Currently developing for International Gaming Community - Join us!

Posted
no sirvio tomas me sale error

D: Puto OOP

Prueba con eso

  
      
        addCommandHandler ( "explosion", 
            function ( thePlayer ) 
                local x, y, z = getElementPosition ( thePlayer ) -- Obtengo la posicion del jugador 
                local rx, ry, rz = getElementRotation ( thePlayer ) -- Obtengo la rotacion del jugador 
                local mat = Matrix.create ( x, y, z, rx, ry, rz ) -- Creo la matrix usando la posicion y la rotacion 
                local forward = Matrix.getForward ( mat ) +3 -- Obtengo la posicion en frente del jugador 
                local pos = ( Matrix.getPosition ( mat ) + forward ) -- Sumo ambos vectores 
                createExplosion ( pos, 11 ) 
            end 
        ) 
      

Currently developing for International Gaming Community - Join us!

Posted
local forward = ( Matrix.getForward ( mat ) * 2 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...