Jump to content

onPlayerWasted


Chaz-CR

Recommended Posts

Posted

Pues bueno me gustaria saber que tengo que usar (eventos) y como combinarlos para hacer un resource sobre spawnear en el hospital mas cercano, se que es con el onPlayerWasted pero no tengo idea de como combinar todos los spawns conforme la distancia! gracias

Posted

Aqui tienes uno creado por @pakito123, anteriormente en el Foro:

local spawnV = 
{ 
    { 255.52216, 255.324234, 0 }, 
    { 255.52216, 255.324234, 0 }, 
    { 255.52216, 255.324234, 0 } 
} 
  
local spawnL = 
{ 
    { 1922.7138671875, -2300.3759765625, 13.546875 }, 
    { 2708.5712890625, -1740, 42.133285522461 }, 
    { 1140, -1474.28515625, 15.796875 } 
} 
  
local spawnF = 
{ 
    { 255.52216, 255.324234, 0 }, 
    { 255.52216, 255.324234, 0 }, 
    { 255.52216, 255.324234, 0 } 
} 
  
addEventHandler( "onPlayerWasted", getRootElement(), 
function() 
    local x, y, z = getElementPosition ( source ) 
    local city = getZoneName ( x, y, z, true ) 
    if city == "Las Venturas" then 
        setTimer( spawnPlayer, 2000, 1, source, unpack ( spawnV[ math.random ( #spawnV ) ] )  ) 
        fadeCamera (source, true) 
        setCameraTarget (source, source) 
    elseif city == "San Fierro" then 
        setTimer( spawnPlayer, 2000, 1, source, unpack ( spawnF[ math.random ( #spawnF ) ] )  ) 
        fadeCamera (source, true) 
        setCameraTarget (source, source) 
    elseif city == "Los Santos" then 
        setTimer( spawnPlayer, 2000, 1, source, unpack ( spawnL[ math.random ( #spawnL ) ] )  ) 
        fadeCamera (source, true) 
        setCameraTarget (source, source) 
    else 
        setTimer( spawnPlayer, 2000, 1, source, unpack ( spawnL[ math.random ( #spawnL ) ] )  ) 
        fadeCamera (source, true) 
        setCameraTarget (source, source) 
    end 
end 
) 

Posted

Lo que te dió AlvareZ tendria que funcionar . Porqué? Mira.

Si el player está en la ciudad 'Las Venturas' cuando muere, este se spawneará en la coordenadas especificadas en cada tabla. Solo si está en una zona determinada. Por eso usa getElementPosition y getZoneName.

Suerte

  • Recently Browsing   0 members

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