Jump to content

[Help/Ayuda] Puerta automatica


JkR

Recommended Posts

Posted

Hola estoy intentando hacer una puerta automanica que se abra cuando estes dentro de un colshape y este privatizada por team, este es mi script pero no funciona, espero que ustedes me puedan dar una solucion, gracias

col  = createColTube (145.69999694824, 1917, 20.7, 2, 3) 
root = getRootElement () 
  
othergate1 = createObject ( 980, 145.69999694824, 1917, 20.7, 0, 0, 90)  
                                  
function Open ( pla ) 
    if getElementType ( player ) == "player" then 
        playerTeam = getPlayerTeam ( source ) 
          Clann = getTeamFromName ( "Rebeldes" ) 
            if ( playerTeam ) == Clann then 
            moveObject (othergate1, 1000, 145.69, 1904.4000244141, 20.7)  
end  
end 
end  
addEventHandler ( "onColShapeHit", col, Open) 
  
function Close ( pla ) 
    if getElementType ( player ) == "player" then 
        playerTeam = getPlayerTeam ( source ) 
          Clann = getTeamFromName ( "Rebeldes" ) 
            if ( playerTeam ) == Clann then 
            moveObject (othergate1, 1000, 145.69999694824, 1917, 20.7)  
end 
end 
end 
addEventHandler ( "onColShapeLeave", col, Close ) 
  

Posted

Prueba así, dime que ocurre:

  
col  = createColTube (145.69999694824, 1917, 20.7, 2, 3) 
root = getRootElement () 
  
othergate1 = createObject ( 980, 145.69999694824, 1917, 20.7, 0, 0, 90) 
                                  
function Open ( player ) 
    if getElementType ( player ) == "player" then 
        playerTeam = getPlayerTeam ( player ) 
          Clann = getTeamFromName ( "Rebeldes" ) 
            if ( playerTeam ) == Clann then 
            moveObject (othergate1, 1000, 145.69, 1904.4000244141, 20.7) 
end 
end 
end 
addEventHandler ( "onColShapeHit", col, Open) 
  
function Close ( player ) 
    if getElementType ( player ) == "player" then 
        playerTeam = getPlayerTeam ( player ) 
          Clann = getTeamFromName ( "Rebeldes" ) 
            if ( playerTeam ) == Clann then 
            moveObject (othergate1, 1000, 145.69999694824, 1917, 20.7) 
end 
end 
end 
addEventHandler ( "onColShapeLeave", col, Close ) 
  

PSD: Sin probar.

Posted
Prueba así, dime que ocurre:
  
col  = createColTube (145.69999694824, 1917, 20.7, 2, 3) 
root = getRootElement () 
  
othergate1 = createObject ( 980, 145.69999694824, 1917, 20.7, 0, 0, 90) 
                                  
function Open ( player ) 
    if getElementType ( player ) == "player" then 
        playerTeam = getPlayerTeam ( player ) 
          Clann = getTeamFromName ( "Rebeldes" ) 
            if ( playerTeam ) == Clann then 
            moveObject (othergate1, 1000, 145.69, 1904.4000244141, 20.7) 
end 
end 
end 
addEventHandler ( "onColShapeHit", col, Open) 
  
function Close ( player ) 
    if getElementType ( player ) == "player" then 
        playerTeam = getPlayerTeam ( player ) 
          Clann = getTeamFromName ( "Rebeldes" ) 
            if ( playerTeam ) == Clann then 
            moveObject (othergate1, 1000, 145.69999694824, 1917, 20.7) 
end 
end 
end 
addEventHandler ( "onColShapeLeave", col, Close ) 
  

PSD: Sin probar.

Sigue sin funcionar

Posted
Una respuesta rápida. En vez de:
if ( playerTeam ) == Clann then 

no debería de ser:

if ( playerTeam ) == "Clann" then 

No, porque 'Clann' es una variable.

Posted
Una respuesta rápida. En vez de:
if ( playerTeam ) == Clann then 

no debería de ser:

if ( playerTeam ) == "Clann" then 

No, porque 'Clann' es una variable.

¿Y los

if getElementType ( player ) == "player" then 

por

if getElementType ( source ) == "player" then 

Porque, si sabes que es player, ¿para que lo quieres re-saber (no me sale la palabra)?

Posted
Una respuesta rápida. En vez de:
if ( playerTeam ) == Clann then 

no debería de ser:

if ( playerTeam ) == "Clann" then 

No, porque 'Clann' es una variable.

¿Y los

if getElementType ( player ) == "player" then 

por

if getElementType ( source ) == "player" then 

Porque, si sabes que es player, ¿para que lo quieres re-saber (no me sale la palabra)?

No, realmente no se sabe que 'player' es un player, a la colshape puede entrar un ped, un vehiculo, una colshape, un objeto, etc... por eso la comparación.

Posted

prueva con esto

othergate1= createObject ( 980, 2309.6000976563, 555.09997558594, 12.199999809265, 0 ,0 ,0 ) 
x,y,z = getElementPosition (othergate1) 
col = createColCircle ( x,y, 10, 10 ) 
  
function Open () 
        if getElementType ( source ) == "player" then 
            playerTeam = getPlayerTeam ( source ) 
              Clann = getTeamFromName ( "Rebeldes" ) 
        if ( playerTeam ) == Clann then 
            moveObject (othergate1, 1000, 145.69, 1904.4000244141, 20.7) 
          end 
       end 
    end 
addEventHandler ( "onColShapeHit", col, Open ) 
  
  
function Close () 
        if getElementType ( source ) == "player" then 
            playerTeam = getPlayerTeam ( source ) 
              Clann = getTeamFromName ( "Rebeldes" ) 
        if ( playerTeam ) == Clann then 
                moveObject (othergate1, 1000, 145.69999694824, 1917, 20.7) 
          end 
       end 
    end 
addEventHandler ( "onColShapeLeave", col, Close ) 

Posted
prueva con esto
othergate1= createObject ( 980, 2309.6000976563, 555.09997558594, 12.199999809265, 0 ,0 ,0 ) 
x,y,z = getElementPosition (othergate1) 
col = createColCircle ( x,y, 10, 10 ) 
  
function Open () 
        if getElementType ( source ) == "player" then 
            playerTeam = getPlayerTeam ( source ) 
              Clann = getTeamFromName ( "Rebeldes" ) 
        if ( playerTeam ) == Clann then 
            moveObject (othergate1, 1000, 145.69, 1904.4000244141, 20.7) 
          end 
       end 
    end 
addEventHandler ( "onColShapeHit", col, Open ) 
  
  
function Close () 
        if getElementType ( source ) == "player" then 
            playerTeam = getPlayerTeam ( source ) 
              Clann = getTeamFromName ( "Rebeldes" ) 
        if ( playerTeam ) == Clann then 
                moveObject (othergate1, 1000, 145.69999694824, 1917, 20.7) 
          end 
       end 
    end 
addEventHandler ( "onColShapeLeave", col, Close ) 

Con eso ni si quiera crea el objeto y no manda ningun mensaje el debug

Posted
¿Qué errores te tira en el debugscript?

Me refiero respecto al codigo que yo le pase, no el que tenía inicialmente.

Tampoco tira errores el debugscript con ese

  • Recently Browsing   0 members

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