Jump to content

Puerta por un solo comando [GANG]


eldelahoz

Recommended Posts

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 ) 

Link to comment

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

Link to comment
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 ) 

Link to comment
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 ) 

Link to comment

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 ) 

Link to comment
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 ) 

Link to comment
  • Recently Browsing   0 members

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