Jump to content

ayuda puerta automaticas


Zoon

Recommended Posts

hola amigos, vengo aqui haber si me podrian ayudar con esto tengo este scrip de puertas automaticas funciona bien pero quisiera saber como puedo hacer para que solo se les abra la puerta a los del team "militar" aqui dejo el scrip haber si me pueden ayudar o decirme que debo hacer gracias. se los agradesco

        airportgate = createObject (10828, 1743.6999511719, 536.20001220703, 38.400001525879, 0, 0, 341.53845214844) 
          
        MarkerOpen = createMarker  (1749.6029052734, 554.51977539063, 25.887992858887, "cylinder",10, 255, 0, 0, 255) 
        MarkerClose = createMarker (1735.0040283203, 510.98870849609, 28.605186462402,"cylinder",10, 255, 0, 0, 255) 
      
          
        function abrir ( ) 
        moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 22.60000038147) 
        end 
          
        function cerrar() 
        moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 38.400001525879) 
        end 
        
        addEventHandler( "onMarkerHit", MarkerOpen, abrir) 
        addEventHandler( "onMarkerHit", MarkerClose, cerrar) 

Link to comment
airportgate = createObject (10828, 1743.6999511719, 536.20001220703, 38.400001525879, 0, 0, 341.53845214844) 
          
        MarkerOpen = createMarker  (1749.6029052734, 554.51977539063, 25.887992858887, "cylinder",10, 255, 0, 0, 255) 
        MarkerClose = createMarker (1735.0040283203, 510.98870849609, 28.605186462402,"cylinder",10, 255, 0, 0, 255) 
      
          
        function abrir ( hitElement ) 
        if getTeamName(getPlayerTeam(hitElement)) == "Militar" then 
        moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 22.60000038147) 
        end 
      end 
          
        function cerrar(hitElement) 
        if getTeamName(getPlayerTeam(hitElement)) == "Militar" then 
        moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 38.400001525879) 
        end 
      end 
        
        addEventHandler( "onMarkerHit", MarkerOpen, abrir) 
        addEventHandler( "onMarkerHit", MarkerClose, cerrar) 

Link to comment

gracias funciona pero solo un problemita cada ves que alguien que no es del team militar se pone encima del marker sale este error

[2012-09-23 15:03:44] WARNING: PuertaMilitar\server.lua:8: Bad argument @ 'getTeamName' 

que pueo hacer para que no salga eso?

Link to comment
  
airportgate = createObject (10828, 1743.6999511719, 536.20001220703, 38.400001525879, 0, 0, 341.53845214844) 
          
        MarkerOpen = createMarker  (1749.6029052734, 554.51977539063, 25.887992858887, "cylinder",10, 255, 0, 0, 255) 
        MarkerClose = createMarker (1735.0040283203, 510.98870849609, 28.605186462402,"cylinder",10, 255, 0, 0, 255) 
      
          
        function abrir ( hitElement ) 
        if getTeamName(getPlayerTeam(hitElement)) ~= "Militar" then return end 
        moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 22.60000038147) 
      end 
          
        function cerrar(hitElement) 
        if getTeamName(getPlayerTeam(hitElement)) ~= "Militar" then return end 
        moveObject (airportgate, 5000, 1743.6999511719, 536.20001220703, 38.400001525879) 
      end 
        
        addEventHandler( "onMarkerHit", MarkerOpen, abrir) 
        addEventHandler( "onMarkerHit", MarkerClose, cerrar) 
  

Edited by Guest
Link to comment
  • Recently Browsing   0 members

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