Jump to content

Como Hacer ZonaDM?


maauroo

Recommended Posts

Posted

Hola.. Como Hago Un ZonaDm Con Cmds Osea Ir A Una Zona de Miniguns Con Vario Teleport En Un Interior? Que Este Proyecto Que Tenga Respawn Cuando Lo Matan y El Cmd /SalirDm.. Desde Ya Se Los Agradesco.

Posted
setElementPosition -- Para posicionar. 
setTimer -- Para los timers de respawn. 
addCommandHandler -- Para los comandos 
addEventHandler -- "onPlayerWasted" para poner posteriormente el timer de respawn. 

Posted

te agradeseria si me ayudarias.. Mira:

function consoleSetPlayerPosition ( source, commandName, posX, posY, posZ ) 
    setElementPosition ( source, 2386.4592,1032.8708,10.5474 ) 
end 
addCommandHandler ( "setpos", consoleSetPlayerPosition  ) 

Y Quiero Poner Vario Teleport y se telestrasporte al azar.

Posted
local posiciones = 
    { 
        { 2386.4592, 1032.8708, 10.5474 }, 
        { 0, 0, 5 }, 
    } 
  
function consoleSetPlayerPosition ( thePlayer ) 
    local azar = math.random ( #posiciones ) 
    setElementPosition ( thePlayer, unpack ( posiciones [ azar ] ) ) 
end 
addCommandHandler ( "setpos", consoleSetPlayerPosition  ) 

Posted

Ya Esta.. Ahora Como Hago Para Que Cuando cuando lo matan respawn en el mismo dm.. y lo que no queran jugar mas al dm poner un cmd para /salirdm?

Posted

Lo Hise Asi:

local posiciones = 
    { 
    { 2170.3459, 1611.5499, 999.9727 }, 
    { 2193.1315, 1625.0666, 999.9719 }, 
    { 2199.9279, 1608.9176, 999.9716 }, 
    { 2225.5649, 1620.4234, 999.9655 }, 
    { 2229.4406, 1597.1533, 999.968 }, 
    { 2229.7163, 1574.3369, 999.9692 }, 
    { 2219.9885, 1552.2485, 1004.7188 }, 
    { 2205.5302, 1580.3706, 999.9785 }, 
    { 2187.1303, 1591.5382, 999.9782 }, 
    { 2175.5495, 1577.6177, 999.9683 }, 
    { 2177.8242, 1601.6416, 999.9774 } 
    } 
  
  
addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
        setTimer( spawnPlayer, 2000, 1, thePlayer, posiciones ) 
    end 
) 
  
function consoleSetPlayerPosition ( thePlayer ) 
     local azar = math.random ( #posiciones ) 
     setElementInterior ( thePlayer, 1 ) 
    setElementPosition ( thePlayer, unpack ( posiciones [ azar ] ) ) 
end 
  
addCommandHandler ( "setpos" , consoleSetPlayerPosition   ) 

Pero Me Parece Ami Esta Mal.. "addEventHandler" Lo Que Estoy Haciendo Es El Respawn.. Osea Que Cuando Muere Vuelva Al Mismo Lucar Con Las "Posiciones" Que Estan Hay.. Como Hago?

Posted

lo cambie pero no pasa nada.. Lo Que Yo Quiero Es Que Cuando Lo Matan Vuelva A Respawnear En El Mismo Lugar ZonaDm. Como Lo Puedo Hacer?

Posted
lo cambie pero no pasa nada.. Lo Que Yo Quiero Es Que Cuando Lo Matan Vuelva A Respawnear En El Mismo Lugar ZonaDm. Como Lo Puedo Hacer?
addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
        setTimer( spawnPlayer, 2000, 1, thePlayer, posiciones ) 
    end 
) 

Posted

Hola.. Hay Lo Arregle.. Pero Cuando Respawnea No Va Al Interior.. Ven:

local posiciones = 
    { 
    { 2170.3459, 1611.5499, 999.9727 }, 
    { 2193.1315, 1625.0666, 999.9719 }, 
    { 2199.9279, 1608.9176, 999.9716 }, 
    { 2225.5649, 1620.4234, 999.9655 }, 
    { 2229.4406, 1597.1533, 999.968 }, 
    { 2229.7163, 1574.3369, 999.9692 }, 
    { 2219.9885, 1552.2485, 1004.7188 }, 
    { 2205.5302, 1580.3706, 999.9785 }, 
    { 2187.1303, 1591.5382, 999.9782 }, 
    { 2175.5495, 1577.6177, 999.9683 }, 
    { 2177.8242, 1601.6416, 999.9774 } 
    } 
  
  
addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
        local azar = math.random ( #posiciones ) 
        setTimer( spawnPlayer, 2000, 1, source, unpack ( posiciones [ azar ] )) 
    end 
) 
  
function consoleSetPlayerPosition ( thePlayer ) 
     local azar = math.random ( #posiciones ) 
     setElementInterior ( thePlayer, 1 ) 
    setElementPosition ( thePlayer, unpack ( posiciones [ azar ] ) ) 
end 
  
addCommandHandler ( "setpos" , consoleSetPlayerPosition   ) 

Al Respawn Hay Que Ponerle La Id Del Interior Pero No Se Como Hacer.. Como Lo Hago?

Posted

Pero Como Lo Puedo Colocar??

addEventHandler( "onPlayerWasted",thePlayer, getRootElement( ), 
    function() 
        local azar = math.random ( #posiciones ) 
        setTimer( spawnPlayer, 2000, 1, source, unpack ( posiciones [ azar ] )) 
    end 
) 

Posted
local posiciones = 
    { 
    { 2170.3459, 1611.5499, 999.9727 }, 
    { 2193.1315, 1625.0666, 999.9719 }, 
    { 2199.9279, 1608.9176, 999.9716 }, 
    { 2225.5649, 1620.4234, 999.9655 }, 
    { 2229.4406, 1597.1533, 999.968 }, 
    { 2229.7163, 1574.3369, 999.9692 }, 
    { 2219.9885, 1552.2485, 1004.7188 }, 
    { 2205.5302, 1580.3706, 999.9785 }, 
    { 2187.1303, 1591.5382, 999.9782 }, 
    { 2175.5495, 1577.6177, 999.9683 }, 
    { 2177.8242, 1601.6416, 999.9774 } 
    } 
  
  
addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
        local azar = math.random ( #posiciones ) 
        setTimer( spawnPlayer, 2000, 1, source, unpack ( posiciones [ azar ] )) 
    end 
) 
  
function consoleSetPlayerPosition ( thePlayer ) 
     local azar = math.random ( #posiciones ) 
     setElementInterior ( thePlayer, 1 ) 
    setElementPosition ( thePlayer, unpack ( posiciones [ azar ] ) ) 
     interior = getElementInterior ( thePlayer ) 
end 
  
addCommandHandler ( "setpos" , consoleSetPlayerPosition   ) 

addEventHandler( "onPlayerWasted",thePlayer, getRootElement( ), 
    function() 
        local azar = math.random ( #posiciones ) 
        setElementInterior( thePlayer, interior ) 
        setTimer( spawnPlayer, 2000, 1, source, unpack ( posiciones [ azar ] )) 
    end 
) 

algo asi creo

Posted

@ElMota: Eso esta mal.

local posiciones = 
    { 
        { 2170.3459, 1611.5499, 999.9727 }, 
        { 2193.1315, 1625.0666, 999.9719 }, 
        { 2199.9279, 1608.9176, 999.9716 }, 
        { 2225.5649, 1620.4234, 999.9655 }, 
        { 2229.4406, 1597.1533, 999.968 }, 
        { 2229.7163, 1574.3369, 999.9692 }, 
        { 2219.9885, 1552.2485, 1004.7188 }, 
        { 2205.5302, 1580.3706, 999.9785 }, 
        { 2187.1303, 1591.5382, 999.9782 }, 
        { 2175.5495, 1577.6177, 999.9683 }, 
        { 2177.8242, 1601.6416, 999.9774 } 
    } 
  
  
addEventHandler ( "onPlayerWasted", getRootElement( ), 
    function ( ) 
        local azar = math.random ( #posiciones ) 
        local interior = getElementInterior ( source ) 
        local skin = getElementModel ( source ) 
        local x, y, z = unpack ( posiciones [ azar ] ) 
        setTimer( spawnPlayer, 2000, 1, source, x, y, z, 0, skin, interior ) 
    end 
) 
  
function consoleSetPlayerPosition ( thePlayer ) 
    local azar = math.random ( #posiciones ) 
    setElementInterior ( thePlayer, 1 ) 
    setElementPosition ( thePlayer, unpack ( posiciones [ azar ] ) ) 
end 
addCommandHandler ( "setpos", consoleSetPlayerPosition ) 

Posted

cuando entre usas

local ox, oy, oz = getElementPosition 

y luego haces esto:

function salirDM ( source, commandName, posX, posY, posZ ) 
    setElementPosition ( source, ox, oy, oz ) 
end 
addCommandHandler ( "salirdm", salirDM  ) 

y quiza necesites el interior y las armas.

Posted

Eso no sirviria sin ofender.

local posiciones = 
    { 
        { 2170.3459, 1611.5499, 999.9727 }, 
        { 2193.1315, 1625.0666, 999.9719 }, 
        { 2199.9279, 1608.9176, 999.9716 }, 
        { 2225.5649, 1620.4234, 999.9655 }, 
        { 2229.4406, 1597.1533, 999.968 }, 
        { 2229.7163, 1574.3369, 999.9692 }, 
        { 2219.9885, 1552.2485, 1004.7188 }, 
        { 2205.5302, 1580.3706, 999.9785 }, 
        { 2187.1303, 1591.5382, 999.9782 }, 
        { 2175.5495, 1577.6177, 999.9683 }, 
        { 2177.8242, 1601.6416, 999.9774 } 
    } 
local jugadoresEnDM = { } 
  
addEventHandler ( "onPlayerWasted", getRootElement( ), 
    function ( ) 
        local azar = math.random ( #posiciones ) 
        local interior = getElementInterior ( source ) 
        local skin = getElementModel ( source ) 
        local x, y, z = unpack ( posiciones [ azar ] ) 
        setTimer( spawnPlayer, 2000, 1, source, x, y, z, 0, skin, interior ) 
    end 
) 
  
function consoleSetPlayerPosition ( thePlayer ) 
    local azar = math.random ( #posiciones ) 
    local interior = getElementInterior ( thePlayer ) 
    local x, y, z = getElementPosition ( thePlayer ) 
    setElementInterior ( thePlayer, 1 ) 
    setElementPosition ( thePlayer, unpack ( posiciones [ azar ] ) ) 
    jugadoresEnDM [ thePlayer ] = { interior, x, y, z } -- Agregamos al jugador que uso el comando a nuestra tabla con sus datos. 
end 
addCommandHandler ( "setpos", consoleSetPlayerPosition ) 
  
addCommandHandler ( "salirdm", 
    function ( thePlayer ) 
        if ( jugadoresEnDM [ thePlayer ] ) then -- Si el jugador que uso el comando esta en nuestra tabla.. 
            setElementInterior ( thePlayer, unpack ( jugadoresEnDM [ thePlayer ] ) ) -- Obtenemos los datos del jugador y cambiamos su interior y posicion. 
            jugadoresEnDM [ thePlayer ] = nil 
        end 
    end 
) 

Lean los comentarios, les va a ayudar a entender lo que hice.

Posted

Funciona Correctamente.. Ahora Si Yo Estoy Fuera De ZonaDm, Como Puedo Hacer Para Que Respawne Cuando Mueren Fuera De ZonaDm? ¿Se Entiende?

Posted

Decis cuando el jugador se va del area? o cuando pone "/salirdm"?

local posiciones = 
    { 
        { 2170.3459, 1611.5499, 999.9727 }, 
        { 2193.1315, 1625.0666, 999.9719 }, 
        { 2199.9279, 1608.9176, 999.9716 }, 
        { 2225.5649, 1620.4234, 999.9655 }, 
        { 2229.4406, 1597.1533, 999.968 }, 
        { 2229.7163, 1574.3369, 999.9692 }, 
        { 2219.9885, 1552.2485, 1004.7188 }, 
        { 2205.5302, 1580.3706, 999.9785 }, 
        { 2187.1303, 1591.5382, 999.9782 }, 
        { 2175.5495, 1577.6177, 999.9683 }, 
        { 2177.8242, 1601.6416, 999.9774 } 
    } 
local jugadoresEnDM = { } 
  
addEventHandler ( "onPlayerWasted", getRootElement( ), 
    function ( ) 
        if ( jugadoresEnDM [ source ] ) then 
            local azar = math.random ( #posiciones ) 
            local interior = getElementInterior ( source ) 
            local skin = getElementModel ( source ) 
            local x, y, z = unpack ( posiciones [ azar ] ) 
            setTimer( spawnPlayer, 2000, 1, source, x, y, z, 0, skin, interior ) 
        end 
    end 
) 
  
function consoleSetPlayerPosition ( thePlayer ) 
    local azar = math.random ( #posiciones ) 
    local interior = getElementInterior ( thePlayer ) 
    local x, y, z = getElementPosition ( thePlayer ) 
    setElementInterior ( thePlayer, 1 ) 
    setElementPosition ( thePlayer, unpack ( posiciones [ azar ] ) ) 
    jugadoresEnDM [ thePlayer ] = { interior, x, y, z } -- Agregamos al jugador que uso el comando a nuestra tabla con sus datos. 
end 
addCommandHandler ( "setpos", consoleSetPlayerPosition ) 
  
addCommandHandler ( "salirdm", 
    function ( thePlayer ) 
        if ( jugadoresEnDM [ thePlayer ] ) then -- Si el jugador que uso el comando esta en nuestra tabla.. 
            setElementInterior ( thePlayer, unpack ( jugadoresEnDM [ thePlayer ] ) ) -- Obtenemos los datos del jugador y cambiamos su interior y posicion. 
            jugadoresEnDM [ thePlayer ] = nil 
        end 
    end 
) 

Con este codigo, si el jugador pone "/salirdm", no va a poder respawnear dentro de la zona.

Posted

Funciona Perfectamente.. Por Ultimo Quisiera Saber Como Bloqueo Comandos Cuando Estoy Anentro De Dm Y Poner Que Aparescan Con Armas?

Me Refiero Bloquear Un Comando Cuando Estoy A Dentro De ZonaDm.

Posted

Por Ultimo Quisiera Saber Como Hacer Poner La Id De La Minigun Cuando Entra En ZonaDm Y Bloquear Comandos Cuando Esten Adentro De Zonadm? Se Los Agradesco..

  • Recently Browsing   0 members

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