Jump to content

Puerta para base


Sasu

Recommended Posts

warehouse_door2b = createObject (3037, 834.19921875, -2067.8994140625, 14.10000038147, 0, 0, 90) 
 warehouse_door2b2 = createObject (3037, 839, -2067.8994140625, 14.10000038147, 0, 0, 90) 
  
          
        MarkerOpen = createMarker  (836.90002441406, -2064.6999511719, 12.89999961853, "corona",10, 127, 127, 127, 0) 
        MarkerClose = createMarker (835.70001220703, -2070.6000976563, 12.89999961853,"corona",10, 127, 127, 127, 0) 
      
          
        function abrir ( hitElement ) 
        if getTeamName(getPlayerTeam(hitElement)) ~= "Elite" then return end 
        moveObject (warehouse_door2b, 3037, 834.20001220703, -2067.8999023438, 9.6000003814697) 
        moveObject (warehouse_door2b2, 3037, 839, -2067.8999023438, 9.6000003814697) 
        outputChatBox ( "Bienvenido " .. getPlayerName ( source ).." a la base Elite")       
else 
        outputChatBox ( "Acceso Denegado. Usted no es una fuerza Elite. Contacta a GhostRiden" ) 
        end 
          
        function cerrar(hitElement) 
        if getTeamName(getPlayerTeam(hitElement)) ~= "Elite" then return end 
        moveObject (warehouse_door2b, 3037, 834.19921875, -2067.8994140625, 14.10000038147) 
        moveObject (warehouse_door2b2, 3037, 839, -2067.8994140625, 14.10000038147) 
        end 
        
        addEventHandler( "onMarkerHit", MarkerOpen, abrir) 
        addEventHandler( "onMarkerHit", MarkerClose, cerrar) 

Me ayudan a corregirlo. Cuando inicio el resource me dice: SCRIPT ERROR: base\puerta.lua:14 'end' expected near 'else'.

Es para la puerta de una base.

Link to comment

No se puede usar un 'else' sin un 'if', y tu 'if' ya lo habias cerrado.

warehouse_door2b = createObject ( 3037, 834.19921875, -2067.8994140625, 14.10000038147, 0, 0, 90 ) 
warehouse_door2b2 = createObject ( 3037, 839, -2067.8994140625, 14.10000038147, 0, 0, 90 ) 
  
MarkerOpen = createMarker ( 836.90002441406, -2064.6999511719, 12.89999961853, "corona",10, 127, 127, 127, 0 ) 
MarkerClose = createMarker ( 835.70001220703, -2070.6000976563, 12.89999961853,"corona",10, 127, 127, 127, 0 ) 
  
function abrir ( hitElement ) 
    if ( getTeamName ( getPlayerTeam ( hitElement ) ) == "Elite" ) then 
        moveObject ( warehouse_door2b, 3037, 834.20001220703, -2067.8999023438, 9.6000003814697 ) 
        moveObject ( warehouse_door2b2, 3037, 839, -2067.8999023438, 9.6000003814697 ) 
        outputChatBox ( "Bienvenido " .. getPlayerName ( hitElement ).." a la base Elite", hitElement ) 
    else 
        outputChatBox ( "Acceso Denegado. Usted no es una fuerza Elite. Contacta a GhostRiden", hitElement ) 
    end 
end 
addEventHandler ( "onMarkerHit", MarkerOpen, abrir ) 
  
function cerrar ( hitElement ) 
    if ( getTeamName ( getPlayerTeam ( hitElement ) ) == "Elite" ) then 
        moveObject ( warehouse_door2b, 3037, 834.19921875, -2067.8994140625, 14.10000038147 ) 
        moveObject ( warehouse_door2b2, 3037, 839, -2067.8994140625, 14.10000038147 ) 
    end 
end 
addEventHandler ( "onMarkerHit", MarkerClose, cerrar ) 

Link to comment
  • Recently Browsing   0 members

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