Jump to content

Puerta por un solo comando [GANG]


eldelahoz

Recommended Posts

Posted

Hola como lo dice el titulo quisiera saber como puedo hacer para que una puerta se mueva por un solo comando ya tengo para que se mueva automatica pero quiero saber que ago para ponerla por comando me ayudarian por favor

objeto1 = createObject ( 980, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
x,y,z = getElementPosition (objeto1) 
Zona1 = createColCuboid(1060.5809326172, 1353.7885742188, 10, 14.25, 16.5, 4.75) 
  
function Funcion1 (source) 
if ( getElementData ( source, "gang" ) == "Clan" ) then 
        moveObject ( objeto1, 2000, 1067.3994140625, 1362, 18, 0, 0, 0 ) 
    outputChatBox ( "Bienvenido", source, 0, 255, 0, true ) 
    else 
    outputChatBox ( "Tu no eres de Clan!", source, 255, 0, 0, true ) 
end 
end 
addEventHandler ( "onColShapeHit", Zona1, Funcion1 ) 
  
function Funcion2 () 
        moveObject ( objeto1, 2000, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
        outputChatBox ( "Abandonando Base!", source, 0, 255, 0, true ) 
end 
addEventHandler ( "onColShapeLeave", Zona1, Funcion2 ) 

lgEoigY.png

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

Usa

addCommandHandler 

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

mmm si yo se pero que orden usaria asi

objeto1 = createObject ( 980, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
  
function Funcion1 (source) 
if ( getElementData ( source, "gang" ) == "Clan" ) then 
        moveObject ( objeto1, 2000, 1067.3994140625, 1362, 18, 0, 0, 0 ) 
    outputChatBox ( "Bienvenido", source, 0, 255, 0, true ) 
    else 
    outputChatBox ( "Tu no eres de Clan!", source, 255, 0, 0, true ) 
end 
end 
addEventHandler ( "onColShapeHit", Funcion1 ) 
addCommandHandler ("abrir", Funcion1 ) 
  
function Funcion2 () 
        moveObject ( objeto1, 2000, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
        outputChatBox ( "Abandonando Base!", source, 0, 255, 0, true ) 
end 
addEventHandler ( "onColShapeLeave", Funcion2 ) 
addCommandHandler ("abrir", Funcion2 ) 

o asi

objeto1 = createObject ( 980, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
  
addCommandHandler ("abrir", 
function Funcion1 (source) 
if ( getElementData ( source, "gang" ) == "Clan" ) then 
        moveObject ( objeto1, 2000, 1067.3994140625, 1362, 18, 0, 0, 0 ) 
    outputChatBox ( "Bienvenido", source, 0, 255, 0, true ) 
    else 
    outputChatBox ( "Tu no eres de Clan!", source, 255, 0, 0, true ) 
end 
end 
addEventHandler ( "onColShapeHit", Funcion1 ) 
) 
  
addCommandHandler ("abrir", 
function Funcion2 () 
        moveObject ( objeto1, 2000, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
        outputChatBox ( "Abandonando Base!", source, 0, 255, 0, true ) 
end 
addEventHandler ( "onColShapeLeave", Funcion2 ) 
) 

lgEoigY.png

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

Proba el primero.

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
objeto1 = createObject ( 980, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
  
function Funcion1 ( source ) 
    if ( getElementData ( source, "gang" ) == "Clan" ) then 
        moveObject ( objeto1, 2000, 1067.3994140625, 1362, 18, 0, 0, 0 ) 
        outputChatBox ( "Bienvenido", source, 0, 255, 0, true ) 
    else 
        outputChatBox ( "Tu no eres de Clan!", source, 255, 0, 0, true ) 
    end 
end 
addCommandHandler ( "abrir", Funcion1 ) 
  
function Funcion2 ( ) 
    moveObject ( objeto1, 2000, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
    outputChatBox ( "Abandonando Base!", source, 0, 255, 0, true ) 
end 
addCommandHandler ( "abrir", Funcion2 ) 

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

Ambos comandos son el mismo, cambia uno a "cerrar" o crea una variable para definir el estado de la puerta.

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
local objeto1 = createObject ( 980, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
local state = false 
  
function Funcion1 ( source ) 
    if ( getElementData ( source, "gang" ) == "Clan" ) then 
        if ( not state ) then 
            moveObject ( objeto1, 2000, 1067.3994140625, 1362, 18, 0, 0, 0 ) 
            outputChatBox ( "Bienvenido", source, 0, 255, 0, true ) 
            state = true 
        else 
            moveObject ( objeto1, 2000, 1067.3994140625, 1362, 12.300000190735, 0, 0, 0 ) 
            outputChatBox ( "Abandonando Base!", source, 0, 255, 0, true ) 
            state = false 
        end 
    else 
        outputChatBox ( "Tu no eres de Clan!", source, 255, 0, 0, true ) 
    end 
end 
addCommandHandler ( "abrir", Funcion1 ) 

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

Que raro, deberia funcionar.

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

Lo tengo asi por que le quite los mensajes

local objeto4 = createObject ( 980, 1037.3000488281, 1304.0999755859, 22.5, 0, 0, 180 ) 
local state1 = false 
  
function Funcion7 ( source ) 
    if ( getElementData ( source, "gang" ) == "Clan" ) then 
        if ( not state1 ) then 
            moveObject ( objeto4, 2000, 1037.3000488281, 1304.0999755859, 28.5, 0, 0, 0 ) 
            else 
            state1 = true 
            moveObject ( objeto4, 2000, 1037.3000488281, 1304.0999755859, 22.5, 0, 0, 0 ) 
            state1 = false 
        end 
    end 
end 
addCommandHandler ( "LGTentradap", Funcion7 ) 

lgEoigY.png

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

Ahi tenes el problema, al cambiar el codigo, le cambiaste de posicion a una de las variables.

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
local objeto4 = createObject ( 980, 1037.3000488281, 1304.0999755859, 22.5, 0, 0, 180 ) 
local state1 = false 
  
function Funcion7 ( source ) 
    if ( getElementData ( source, "gang" ) == "Clan" ) then 
        if ( not state1 ) then 
            moveObject ( objeto4, 2000, 1037.3000488281, 1304.0999755859, 28.5, 0, 0, 0 ) 
            state1 = true -- Habias movido esta variable. 
            else 
            moveObject ( objeto4, 2000, 1037.3000488281, 1304.0999755859, 22.5, 0, 0, 0 ) 
            state1 = false 
        end 
    end 
end 
addCommandHandler ( "LGTentradap", Funcion7 ) 

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...